From: Oleg Nesterov Date: Wed, 11 Sep 2013 21:24:40 +0000 (-0700) Subject: exec: proc_exec_connector() should be called only once X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9beb266f2d7e5362c5bb9f999255aa1af5318aef;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git exec: proc_exec_connector() should be called only once A separate one-liner with the minor fix. PROC_EVENT_EXEC reports the "exec" event, but this message is sent at least twice if search_binary_handler() is called by ->load_binary() recursively, say, load_script(). Move it to exec_binprm(), this is "depth == 0" code too. Signed-off-by: Oleg Nesterov Acked-by: Kees Cook Cc: Al Viro Cc: Evgeniy Polyakov Cc: Zach Levis Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/exec.c b/fs/exec.c index b6e35ec818a2..d51f7172832b 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1404,7 +1404,6 @@ int search_binary_handler(struct linux_binprm *bprm) if (bprm->file) fput(bprm->file); bprm->file = NULL; - proc_exec_connector(current); return retval; } read_lock(&binfmt_lock); @@ -1455,6 +1454,7 @@ static int exec_binprm(struct linux_binprm *bprm) trace_sched_process_exec(current, old_pid, bprm); ptrace_event(PTRACE_EVENT_EXEC, old_vpid); current->did_exec = 1; + proc_exec_connector(current); } return ret;