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

Commit 9beb266f authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

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: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Zach Levis <zml@linux.vnet.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 131b2f9f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;