Documenting ptrace access mode checking
Hi Jann, Stephen, et al.
Jann, since you recently committed a patch in this area, and Stephen,
since you committed 006ebb40d3d much further back in time, I wonder if
you might help me by reviewing the text below that I propose to add to
the ptrace(2) man page, in order to document "ptrace access mode
checking" that is performed in various parts of the kernel-user-space
interface. Of course, I welcome input from anyone else as well.
Here's the new ptrace(2) text. Any comments, technical or terminological
fixes, other improvements, etc. are welcome.
Ptrace access mode checking
Various parts of the kernel-user-space API (not just ptrace(2)
operations), require so-called "ptrace access mode permissions"
which are gated by Linux Security Modules (LSMs) such as
SELinux, Yama, Smack, or the default LSM. Prior to Linux
2.6.27, all such checks were of a single type. Since Linux
2.6.27, two access mode levels are distinguished:
For "read" operations or other operations that are less
dangerous, such as: get_robust_list(2); kcmp(2); reading
/proc/[pid]/auxv, /proc/[pid]/environ, or
/proc/[pid]/stat; or readlink(2) of a /proc/[pid]/ns/*
For "write" operations, or other operations that are