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

2019-04-30 Thread Cyrill Gorcunov
On Tue, Apr 30, 2019 at 12:56:10PM +0200, Michal Koutný wrote: > On Tue, Apr 30, 2019 at 01:45:17PM +0300, Cyrill Gorcunov > wrote: > > 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 h

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

2019-04-30 Thread Michal Koutný
On Tue, Apr 30, 2019 at 01:45:17PM +0300, Cyrill Gorcunov wrote: > 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

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

2019-04-30 Thread Cyrill Gorcunov
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 ta

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

2019-04-30 Thread Kirill Tkhai
On 30.04.2019 12:38, Cyrill Gorcunov wrote: > On Tue, Apr 30, 2019 at 12:09:57PM +0300, Kirill Tkhai wrote: >> >> This looks OK for me. >> >> But speaking about existing code it's a secret for me, why we ignore arg_lock >> in binfmt code, e.g. in load_elf_binary(). > > Well, strictly speaking we p

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

2019-04-30 Thread Cyrill Gorcunov
On Tue, Apr 30, 2019 at 12:09:57PM +0300, Kirill Tkhai wrote: > > This looks OK for me. > > But speaking about existing code it's a secret for me, why we ignore arg_lock > in binfmt code, e.g. in load_elf_binary(). Well, strictly speaking we probably should but you know setup of the @arg_start b

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

2019-04-30 Thread Kirill Tkhai
On 30.04.2019 11:18, Michal Koutný wrote: > The commit a3b609ef9f8b ("proc read mm's {arg,env}_{start,end} with mmap > semaphore taken.") added synchronization of reading argument/environment > boundaries under mmap_sem. Later commit 88aa7cc688d4 ("mm: introduce > arg_lock to protect arg_start|end

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

2019-04-30 Thread Michal Koutný
The commit a3b609ef9f8b ("proc read mm's {arg,env}_{start,end} with mmap semaphore taken.") added synchronization of reading argument/environment boundaries under mmap_sem. Later commit 88aa7cc688d4 ("mm: introduce arg_lock to protect arg_start|end and env_start|end in mm_struct") avoided the coars