From: Ingo Molnar Date: Mon, 17 Dec 2007 20:17:56 +0000 (+0100) Subject: vfs: coredumping fix (CVE-2007-6206) X-Git-Tag: v2.6.23.15~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3794fe0f120694d0085316346d679f481966427;p=thirdparty%2Fkernel%2Fstable.git 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 Acked-by: Alan Cox Acked-by: Christoph Hellwig Acked-by: Al Viro Signed-off-by: Linus Torvalds Cc: maximilian attems Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/exec.c b/fs/exec.c index 073b0b8c6d055..401b850d0121b 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)