public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] supress uid comparison test if core output files are pipes
@ 2010-02-22 20:44 Neil Horman
  2010-02-24 11:09 ` Oleg Nesterov
  2010-02-24 21:50 ` Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Neil Horman @ 2010-02-22 20:44 UTC (permalink / raw)
  To: akpm; +Cc: oleg, viro, linux-kernel, nhorman

Modify uid check in do_coredump so as to not apply it in the case of pipes

So 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

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>


 exec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/exec.c b/fs/exec.c
index 6303d18..6af2214 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1987,8 +1987,9 @@ void 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 (!cprm.file->f_op)
 		goto close_fail;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-25 11:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 20:44 [PATCH] supress uid comparison test if core output files are pipes Neil Horman
2010-02-24 11:09 ` Oleg Nesterov
2010-02-24 11:50   ` Neil Horman
2010-02-24 21:50 ` Andrew Morton
2010-02-25  1:32   ` Neil Horman
2010-02-25  2:13     ` Andrew Morton
2010-02-25 11:52       ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox