From: Ingo Molnar Date: Wed, 28 Nov 2007 12:59:18 +0000 (+0100) Subject: vfs: coredumping fix X-Git-Tag: MMI-PSA29.97-13-9~38242 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c46f739dd39db3b07ab5deb4e3ec81e1c04a91af;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git vfs: coredumping fix 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 --- diff --git a/fs/exec.c b/fs/exec.c index 4ccaaa4b13b2..282240afe99e 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1780,6 +1780,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)