[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120309215217.GA725@moon>
Date: Sat, 10 Mar 2012 01:52:17 +0400
From: Cyrill Gorcunov <gorcunov@...nvz.org>
To: Matt Helsley <matthltc@...ibm.com>
Cc: Oleg Nesterov <oleg@...hat.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Pavel Emelyanov <xemul@...allels.com>,
Kees Cook <keescook@...omium.org>, Tejun Heo <tj@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] c/r: prctl: Add ability to set new mm_struct::exe_file v3
On Fri, Mar 09, 2012 at 01:46:37PM -0800, Matt Helsley wrote:
> > >
> > > I simply do not understand what mm->num_exe_file_vmas means after
> > > PR_SET_MM_EXE_FILE.
>
> I think it should fail if the num_exe_file_vmas is not 0 when
> PR_SET_MM_EXE_FILE is used. It's simple, keeps things clear, might
> catch userspace bugs (harder to accidentally leave a mapping of the original
> executable), and could avoid kernel bugs too.
Yes, and in last version (whuch I just sent out) we have at the very beginning
of the function
+ if (mm->num_exe_file_vmas)
+ return -EBUSY;
> >
> > Wait, Oleg, I'm confused, in case if there *is* exitsting VM_EXECUTABLEs
> > then we jump into first banch and simply replace old exe_file.
>
> What happens if multiple prctl calls are made? We'll have a mix of N
> executable files that've been mapped n_i times. I think we're better off
> just returning an error in that case -- -EBUSY or something.
>
> > If there is no VM_EXECUTABLEs, then we simply setup new exe_file
> > and num_exe_file_vmas remains zero.
>
> Which is fine.
>
Matt, please check the last version, and tell me if it's fine for you.
Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists