Messages in this thread | | | Date | Wed, 24 Jun 2009 16:37:06 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH 1/1] mm_for_maps: simplify, use ptrace_may_access() |
| |
On 06/24, Roland McGrath wrote: > > > Also, we do not need to take ->mmap_sem in advance. In fact I think > > mm_for_maps() should not play with ->mmap_sem at all, the caller should > > take this lock. > > Agreed. It has only one caller (though two forks of it) in > fs/proc/task_{no,}mmu.c and it looks easy to change. > > > With or without this patch, without ->cred_guard_mutex held we can race > > with exec() and get the new ->mm but check old creds. > > It looks safe and proper for mm_for_maps() to take that mutex around its > check. Your patch looks good to me as it is, and taking cred_guard_mutex > can be another security fix patch on top.
Agreed, will do.
Oleg.
| |