Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7397bbba authored by Victor Lourme's avatar Victor Lourme Committed by GitHub
Browse files
parent 09665e41
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1094,6 +1094,13 @@ int flush_old_exec(struct linux_binprm * bprm)
	flush_thread();
	current->personality &= ~bprm->per_clear;

	/*
	 * We have to apply CLOEXEC before we change whether the process is
	 * dumpable (in setup_new_exec) to avoid a race with a process in userspace
	 * trying to access the should-be-closed file descriptors of a process
 	 * undergoing exec(2).
	 */
	do_close_on_exec(current->files);
	return 0;

out:
@@ -1144,7 +1151,6 @@ void setup_new_exec(struct linux_binprm * bprm)
	current->self_exec_id++;
			
	flush_signal_handlers(current, 0);
	do_close_on_exec(current->files);
}
EXPORT_SYMBOL(setup_new_exec);