Re: [PATCH 1/3] mm: get_cmdline use arg_lock instead of mmap_sem

From: Cyrill Gorcunov
Date: Tue Apr 30 2019 - 06:45:25 EST


On Tue, Apr 30, 2019 at 12:53:51PM +0300, Kirill Tkhai wrote:
> >
> > Well, strictly speaking we probably should but you know setup of
> > the @arg_start by kernel's elf loader doesn't cause any side
> > effects as far as I can tell (its been working this lockless
> > way for years, mmap_sem is taken later in the loader code).
> > Though for consistency sake we probably should set it up
> > under the spinlock.
>
> Ok, so elf loader doesn't change these parameters.
> Thanks for the explanation.

It setups these parameters unconditionally. I need to revisit
this moment. Technically (if only I'm not missing something
obvious) we might have a race here with prctl setting up new
params, but this should be harmless since most of them (except
stack setup) are purely informative data.