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

2019-04-17 Thread Michal Hocko
On Wed 17-04-19 16:41:42, Michal Koutny wrote: > On Wed, Apr 17, 2019 at 03:41:52PM +0200, Michal Hocko > wrote: > > Don't we need to use the lock in prctl_set_mm as well then? > > Correct. The patch alone just moves the race from > get_cmdline/prctl_set_mm_map to get_cmdline/prctl_set_mm. > >

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

2019-04-17 Thread Michal Koutný
On Wed, Apr 17, 2019 at 03:41:52PM +0200, Michal Hocko wrote: > Don't we need to use the lock in prctl_set_mm as well then? Correct. The patch alone just moves the race from get_cmdline/prctl_set_mm_map to get_cmdline/prctl_set_mm. arg_lock could be used in prctl_set_mm but the better idea (IMO

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

2019-04-17 Thread Michal Hocko
On Wed 17-04-19 14:03:47, Michal Koutny 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

[PATCH] mm: get_cmdline use arg_lock instead of mmap_sem

2019-04-17 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