Re: [PATCH] supress uid comparison test if core output files arepipes

From: Neil Horman
Date: Wed Feb 24 2010 - 06:50:40 EST


On Wed, Feb 24, 2010 at 12:09:03PM +0100, Oleg Nesterov wrote:
> 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?
>
Yes, thats correct.

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

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

> Oleg.
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/