diff options
author | Oleg Nesterov <oleg@redhat.com> | 2009-07-10 03:27:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-08-16 14:27:35 -0700 |
commit | 60634e4b830850bb38016f1e6a7a7358eba8118c (patch) | |
tree | 48762263e12695b03519922263c80625c7c60cf8 /fs/proc/task_nommu.c | |
parent | a79c30e57c0eac03aae8be4649958f8592141d20 (diff) |
mm_for_maps: shift down_read(mmap_sem) to the caller
commit 00f89d218523b9bf6b522349c039d5ac80aa536d upstream.
mm_for_maps() takes ->mmap_sem after security checks, this looks
strange and obfuscates the locking rules. Move this lock to its
single caller, m_start().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/proc/task_nommu.c')
-rw-r--r-- | fs/proc/task_nommu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index 5d84e7121df..737d219c799 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -137,6 +137,7 @@ static void *m_start(struct seq_file *m, loff_t *pos) priv->task = NULL; return NULL; } + down_read(&mm->mmap_sem); /* start from the Nth VMA */ for (vml = mm->context.vmlist; vml; vml = vml->next) |