proc: make check_mem_permission() return an mm_struct on success
authorStephen Wilson <wilsons@start.ca>
Sun, 13 Mar 2011 19:49:23 +0000 (15:49 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 23 Mar 2011 20:36:59 +0000 (16:36 -0400)
commit8b0db9db19858b08c46a84540acfd35f6e6487b8
treef8cad66b43b21ac8cc58c6173b86aaa9ee3d4b5f
parent18f661bcf898742212182d75f22f05b048cc04bb
proc: make check_mem_permission() return an mm_struct on success

This change allows us to take advantage of access_remote_vm(), which in turn
eliminates a security issue with the mem_write() implementation.

The previous implementation of mem_write() was insecure since the target task
could exec a setuid-root binary between the permission check and the actual
write.  Holding a reference to the target mm_struct eliminates this
vulnerability.

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