mm_for_maps: shift down_read(mmap_sem) to the caller
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>
This commit is contained in:
committed by
James Morris
parent
13f0feafa6
commit
00f89d2185
@@ -119,6 +119,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
|
||||
mm = mm_for_maps(priv->task);
|
||||
if (!mm)
|
||||
return NULL;
|
||||
down_read(&mm->mmap_sem);
|
||||
|
||||
tail_vma = get_gate_vma(priv->task);
|
||||
priv->tail_vma = tail_vma;
|
||||
|
Reference in New Issue
Block a user