diff options
author | 2008-04-29 01:01:38 -0700 | |
---|---|---|
committer | 2008-04-29 08:06:17 -0700 | |
commit | 638fa202cdb207083a12d6f73e313605a8fc1037 (patch) | |
tree | e049d74e9f7e15a55149dc17482572c8b2aefa18 /fs/proc/root.c | |
parent | proc: switch to proc_create() (diff) | |
download | wireguard-linux-638fa202cdb207083a12d6f73e313605a8fc1037.tar.xz wireguard-linux-638fa202cdb207083a12d6f73e313605a8fc1037.zip |
procfs: mem permission cleanup
This cleans up the permission checks done for /proc/PID/mem i/o calls. It
puts all the logic in a new function, check_mem_permission().
The old code repeated the (!MAY_PTRACE(task) || !ptrace_may_attach(task))
magical expression multiple times. The new function does all that work in one
place, with clear comments.
The old code called security_ptrace() twice on successful checks, once in
MAY_PTRACE() and once in __ptrace_may_attach(). Now it's only called once,
and only if all other checks have succeeded.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/root.c')
0 files changed, 0 insertions, 0 deletions