aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-09-11 17:24:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:59:05 -0400
commit9beb266f2d7e5362c5bb9f999255aa1af5318aef (patch)
tree96ba701872c5b66b1801f785a6a50b6d3b74e2b1 /fs/exec.c
parent131b2f9f1214f338f0bf7c0d9760019f2b1d0c20 (diff)
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 <oleg@redhat.com> Acked-by: Kees 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c2
1 files changed, 1 insertions, 1 deletions
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)
1404 if (bprm->file) 1404 if (bprm->file)
1405 fput(bprm->file); 1405 fput(bprm->file);
1406 bprm->file = NULL; 1406 bprm->file = NULL;
1407 proc_exec_connector(current);
1408 return retval; 1407 return retval;
1409 } 1408 }
1410 read_lock(&binfmt_lock); 1409 read_lock(&binfmt_lock);
@@ -1455,6 +1454,7 @@ static int exec_binprm(struct linux_binprm *bprm)
1455 trace_sched_process_exec(current, old_pid, bprm); 1454 trace_sched_process_exec(current, old_pid, bprm);
1456 ptrace_event(PTRACE_EVENT_EXEC, old_vpid); 1455 ptrace_event(PTRACE_EVENT_EXEC, old_vpid);
1457 current->did_exec = 1; 1456 current->did_exec = 1;
1457 proc_exec_connector(current);
1458 } 1458 }
1459 1459
1460 return ret; 1460 return ret;