aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2010-03-05 16:44:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:46 -0500
commit76595f79d76fbe6267a51b3a866a028d150f06d4 (patch)
treeeff36adfb339f8cb57b07fd9f09d37d982aa354e /fs/exec.c
parent5c99cbf49a6e1a1efd25b11f4604c65c455e1612 (diff)
coredump: suppress uid comparison test if core output files are pipes
Modify uid check in do_coredump so as to not apply it in the case of pipes. This just got noticed in testing. The end of do_coredump validates the uid of the inode for the created file against the uid of the crashing process to ensure that no one can pre-create a core file with different ownership and grab the information contained in the core when they shouldn' tbe able to. This causes failures when using pipes for a core dumps if the crashing process is not root, which is the uid of the pipe when it is created. The fix is simple. Since the check for matching uid's isn't relevant for pipes (a process can't create a pipe that the uermodehelper code will open anyway), we can just just skip it in the event ispipe is non-zero Reverts a pipe-affecting change which was accidentally made in : commit c46f739dd39db3b07ab5deb4e3ec81e1c04a91af : Author: Ingo Molnar <mingo@elte.hu> : AuthorDate: Wed Nov 28 13:59:18 2007 +0100 : Commit: Linus Torvalds <torvalds@woody.linux-foundation.org> : CommitDate: Wed Nov 28 10:58:01 2007 -0800 : : vfs: coredumping fix Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 829a6c6d1803..49cdaa19e5b9 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1936,8 +1936,9 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
1936 /* 1936 /*
1937 * Dont allow local users get cute and trick others to coredump 1937 * Dont allow local users get cute and trick others to coredump
1938 * into their pre-created files: 1938 * into their pre-created files:
1939 * Note, this is not relevant for pipes
1939 */ 1940 */
1940 if (inode->i_uid != current_fsuid()) 1941 if (!ispipe && (inode->i_uid != current_fsuid()))
1941 goto close_fail; 1942 goto close_fail;
1942 if (!cprm.file->f_op) 1943 if (!cprm.file->f_op)
1943 goto close_fail; 1944 goto close_fail;