Re: [RFC] c/r: prctl: Add ability to set new mm_struct::exe_file

From: Oleg Nesterov
Date: Mon Mar 05 2012 - 11:38:37 EST


On 03/05, Cyrill Gorcunov wrote:
>
> On Mon, Mar 05, 2012 at 04:40:29PM +0100, Oleg Nesterov wrote:
>
> > > This prctl does cheat the kernel
> >
> > Yep. Except, well, it cheats the user-space.
>
> And kernel as well, since this link is not anymore
> the same as it was, and memory read from this file
> (at execution time) will keep data irrelevant to what
> the new symlink points to (but it's exactly by design).

The kernel will never use this file for reading. It is only
used as a placeholder for ->f_path shown in proc.

User-space can be confused, yes, this is by design.

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/