diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-21 02:20:19 +0200 |
---|---|---|
committer | Adrian Bunk <bunk@kernel.org> | 2008-01-21 02:20:19 +0200 |
commit | 0b8a0a777d2d114f84716117ffb36a3d3644b7fe (patch) | |
tree | 6c26d02c009a3589d591702f27f3cd5977f69f2b | |
parent | b39c2791e24103cd13375843cb48a5046395902d (diff) |
vfs: coredumping fix (CVE-2007-6206)
fix: http://bugzilla.kernel.org/show_bug.cgi?id=3043
only allow coredumping to the same uid that the coredumping
task runs under.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
-rw-r--r-- | fs/exec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c index 91a36b27ec9..f28672f6a17 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1512,6 +1512,12 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) if (!S_ISREG(inode->i_mode)) goto close_fail; + /* + * Dont allow local users get cute and trick others to coredump + * into their pre-created files: + */ + if (inode->i_uid != current->fsuid) + goto close_fail; if (!file->f_op) goto close_fail; if (!file->f_op->write) |