public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: akpm@linux-foundation.org, viro@zeniv.linux.org.uk,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] supress uid comparison test if core output files are pipes
Date: Wed, 24 Feb 2010 12:09:03 +0100	[thread overview]
Message-ID: <20100224110903.GA18240@redhat.com> (raw)
In-Reply-To: <20100222200851.GD3344@hmsreliant.think-freely.org>

On 02/22, Neil Horman wrote:
>
> --- 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;

Ah. This is because the previous recursion-check moved create_write_pipe()
from current's context to kthread's context, right?

Looks like a right (and "must have") fix for recent -mm changes to me.



This also reminds me do_coredump() asks for cleanup. I'll try to redo/resend
my old cleanup patches on top of your changes.

Oleg.


  reply	other threads:[~2010-02-24 11:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100224110903.GA18240@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox