amd64: treat procctl(P_PID, 0) as request for current process
Fixes: f833ab9dd187 ("procctl(2): add consistent shortcut P_ID:0 as curproc")
compat/freebsd32 procctl(2): cache some uap members
procctl(2): allow in capability mode to operate on itself
If the target is P_PID and it specifies either pid 0 (shortcut for
itself) or current pid, then:
- allow MD procctls. Currently all amd64 controls are safe for curproc.
- allow commands marked cap_enabled in procctl_cmds_info.
Commands that might act on other processes, notably the reaper and OOM
protection controls, stay disabled.
procctl.2: document cap mode
tests/sys/capsicum: test procctl(2) in capability mode
Check that, in capability mode:
- status and control requests work for the calling process, with both
the zero shortcut and the explicit process ID;
- the reaper and OOM protection requests are refused with ECAPMODE,
even for the calling process;
- other processes and process groups cannot be targeted, including
with machine-dependent requests;
- a refused request delivers SIGTRAP when PROC_TRAPCAP_CTL is enabled.Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped