Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256862
b: refs/heads/master
c: bb188d7
h: refs/heads/master
v: v3
  • Loading branch information
Denys Vlasenko authored and Oleg Nesterov committed Jul 1, 2011
1 parent 98e9c66 commit 01a3844
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 479bf98c1c29b40d86e40a4e6e4944c2f03d9493
refs/heads/master: bb188d7e64deb0e9cf13a99f44ae0065de5352d6
9 changes: 8 additions & 1 deletion trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
unsigned int depth = bprm->recursion_depth;
int try,retval;
struct linux_binfmt *fmt;
pid_t old_pid;

retval = security_bprm_check(bprm);
if (retval)
Expand All @@ -1371,6 +1372,11 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
if (retval)
return retval;

/* Need to fetch pid before load_binary changes it */
rcu_read_lock();
old_pid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));
rcu_read_unlock();

retval = -ENOENT;
for (try=0; try<2; try++) {
read_lock(&binfmt_lock);
Expand All @@ -1390,7 +1396,8 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
bprm->recursion_depth = depth;
if (retval >= 0) {
if (depth == 0)
ptrace_event(PTRACE_EVENT_EXEC, 0);
ptrace_event(PTRACE_EVENT_EXEC,
old_pid);
put_binfmt(fmt);
allow_write_access(bprm->file);
if (bprm->file)
Expand Down

0 comments on commit 01a3844

Please sign in to comment.