Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198747
b: refs/heads/master
c: 269b005
h: refs/heads/master
i:
  198745: 8f3e841
  198743: 8feeb6e
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed May 27, 2010
1 parent 1cfab73 commit 38e6de3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 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: 5e43aef530ba39206f7923295388f7ec3c5a7d93
refs/heads/master: 269b005a28e124a341df4adef2c3661cf7371fcc
19 changes: 7 additions & 12 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,12 +1662,15 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
struct task_struct *tsk = current;
struct mm_struct *mm = tsk->mm;
struct completion *vfork_done;
int core_waiters;
int core_waiters = -EBUSY;

init_completion(&core_state->startup);
core_state->dumper.task = tsk;
core_state->dumper.next = NULL;
core_waiters = zap_threads(tsk, mm, core_state, exit_code);

down_write(&mm->mmap_sem);
if (!mm->core_state)
core_waiters = zap_threads(tsk, mm, core_state, exit_code);
up_write(&mm->mmap_sem);

if (unlikely(core_waiters < 0))
Expand Down Expand Up @@ -1860,20 +1863,12 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
binfmt = mm->binfmt;
if (!binfmt || !binfmt->core_dump)
goto fail;
if (!__get_dumpable(cprm.mm_flags))
goto fail;

cred = prepare_creds();
if (!cred)
goto fail;

down_write(&mm->mmap_sem);
/*
* If another thread got here first, or we are not dumpable, bail out.
*/
if (mm->core_state || !__get_dumpable(cprm.mm_flags)) {
up_write(&mm->mmap_sem);
goto fail_creds;
}

/*
* We cannot trust fsuid as being the "true" uid of the
* process nor do we know its entire history. We only know it
Expand Down

0 comments on commit 38e6de3

Please sign in to comment.