summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorYang Shi <yang.shi@linux.alibaba.com>2018-05-12 10:10:04 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2018-05-12 10:10:04 +1000
commitb587e58e4ed3909a1ae67ba231b8cc5366632eb6 (patch)
treed6fef2c2b1d0427761c8e84e77c587c0dce499d2 /kernel
parentf6346e10bbacea857812ba26b638c29effb56d5d (diff)
downloadlinux-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.c4
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);
/*