From: Oleg Nesterov Date: Tue, 23 Jun 2009 19:25:32 +0000 (+0200) Subject: mm_for_maps: simplify, use ptrace_may_access() X-Git-Tag: v2.6.31-rc6~23^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13f0feafa6b8aead57a2a328e2fca6a5828bf286;p=pandora-kernel.git mm_for_maps: simplify, use ptrace_may_access() It would be nice to kill __ptrace_may_access(). It requires task_lock(), but this lock is only needed to read mm->flags in the middle. Convert mm_for_maps() to use ptrace_may_access(), this also simplifies the code a little bit. 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. With or without this patch, without ->cred_guard_mutex held we can race with exec() and get the new ->mm but check old creds. Signed-off-by: Oleg Nesterov Reviewed-by: Serge Hallyn Signed-off-by: James Morris --- Reading git-diff-tree failed