diff options
author | Yang Shi <yang.shi@linux.alibaba.com> | 2018-05-12 10:10:04 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2018-05-12 10:10:04 +1000 |
commit | b587e58e4ed3909a1ae67ba231b8cc5366632eb6 (patch) | |
tree | d6fef2c2b1d0427761c8e84e77c587c0dce499d2 /kernel | |
parent | f6346e10bbacea857812ba26b638c29effb56d5d (diff) | |
download | linux-next-b587e58e4ed3909a1ae67ba231b8cc5366632eb6.tar.gz |
prctl: add comment about mmap_sem and arg_lock
add comment to elaborate why mmap_sem for is used by prctl
Link: http://lkml.kernel.org/r/1524077799-80690-1-git-send-email-yang.shi@linux.alibaba.com
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mateusz Guzik <mguzik@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sys.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 40288fdd567e..63ef036cac37 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2011,6 +2011,10 @@ static int prctl_set_mm_map(int opt, const void __user *addr, unsigned long data return error; } + /* + * arg_lock protects concurent updates but we still need mmap_sem for + * read to exclude races with sys_brk. + */ down_read(&mm->mmap_sem); /* |