Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198746
b: refs/heads/master
c: 5e43aef
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed May 27, 2010
1 parent 8f3e841 commit 1cfab73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 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: d5bf4c4f5f9dcc90b7e25dbb2f7c4436cf6e7ed0
refs/heads/master: 5e43aef530ba39206f7923295388f7ec3c5a7d93
16 changes: 6 additions & 10 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1862,19 +1862,16 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
goto fail;

cred = prepare_creds();
if (!cred) {
retval = -ENOMEM;
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);
put_cred(cred);
goto fail;
goto fail_creds;
}

/*
Expand All @@ -1889,10 +1886,8 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
}

retval = coredump_wait(exit_code, &core_state);
if (retval < 0) {
put_cred(cred);
goto fail;
}
if (retval < 0)
goto fail_creds;

old_cred = override_creds(cred);

Expand Down Expand Up @@ -2009,9 +2004,10 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
if (ispipe)
atomic_dec(&core_dump_count);
fail_unlock:
coredump_finish(mm);
revert_creds(old_cred);
fail_creds:
put_cred(cred);
coredump_finish(mm);
fail:
return;
}

0 comments on commit 1cfab73

Please sign in to comment.