diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-12-17 21:17:56 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-08 12:01:34 -0800 |
commit | b3794fe0f120694d0085316346d679f481966427 (patch) | |
tree | 04b5803fc13b112be4d1dd4c742fcb5e87dfb7c7 /fs | |
parent | b98ebe01754d083dbdfe7bd3cd46fa2106fad4ef (diff) |
vfs: coredumping fix (CVE-2007-6206)
vfs: coredumping fix
patch c46f739dd39db3b07ab5deb4e3ec81e1c04a91af in mainline
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>
Acked-by: Alan Cox <alan@redhat.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Acked-by: Al Viro <viro@ftp.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-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 073b0b8c6d0..401b850d012 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1786,6 +1786,12 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) but keep the previous behaviour for now. */ if (!ispipe && !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) |