proc: hold cred_guard_mutex in check_mem_permission()
authorStephen Wilson <wilsons@start.ca>
Sun, 13 Mar 2011 19:49:22 +0000 (15:49 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 23 Mar 2011 20:36:58 +0000 (16:36 -0400)
commit18f661bcf898742212182d75f22f05b048cc04bb
tree3a0a6edc6e4240bda06fe52d565fe4b1cb4d8b84
parent26947f8c8f9598209001cdcd31bb2162a2e54691
proc: hold cred_guard_mutex in check_mem_permission()

Avoid a potential race when task exec's and we get a new ->mm but check against
the old credentials in ptrace_may_access().

Holding of the mutex is implemented by factoring out the body of the code into a
helper function __check_mem_permission().  Performing this factorization now
simplifies upcoming changes and minimizes churn in the diff's.

Signed-off-by: Stephen Wilson <wilsons@start.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/proc/base.c