GIT: unionfs2-2.6.27.y: coredump: suppress uid comparison test if core output files are pipes
Erez Zadok
ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:15:14 EDT 2010
commit cf1322b5bad073b5c39e2915d7cdbb15b6874321
Author: Neil Horman <nhorman at tuxdriver.com>
Date: Fri Mar 5 13:44:16 2010 -0800
coredump: suppress uid comparison test if core output files are pipes
commit 76595f79d76fbe6267a51b3a866a028d150f06d4 upstream.
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 at elte.hu>
: AuthorDate: Wed Nov 28 13:59:18 2007 +0100
: Commit: Linus Torvalds <torvalds at woody.linux-foundation.org>
: CommitDate: Wed Nov 28 10:58:01 2007 -0800
:
: vfs: coredumping fix
Signed-off-by: Neil Horman <nhorman at tuxdriver.com>
Cc: Andi Kleen <andi at firstfloor.org>
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Alan Cox <alan at lxorguk.ukuu.org.uk>
Cc: Al Viro <viro at zeniv.linux.org.uk>
Cc: Ingo Molnar <mingo at elte.hu>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Cc: maximilian attems <max at stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
diff --git a/fs/exec.c b/fs/exec.c
index 5ec0f56..50da182 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1826,8 +1826,9 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs)
/*
* Dont allow local users get cute and trick others to coredump
* into their pre-created files:
+ * Note, this is not relevant for pipes
*/
- if (inode->i_uid != current->fsuid)
+ if (!ispipe && (inode->i_uid != current->fsuid))
goto close_fail;
if (!file->f_op)
goto close_fail;
More information about the unionfs-cvs
mailing list