HomeFreeBSD

p_candebug(), p_cansee(): always allow for curproc

Description

p_candebug(), p_cansee(): always allow for curproc

Privilege checks in both functions should allow the current process to
infer information about itself, as well as use the interfaces that are
proclaimed 'debugging', for instance, procctl(2).

Note that in p_cansee() case, explicit comparision of curproc and p
avoids a race where the process might change credentials and cause
thread to compare its cached stale credentials against updated process
creds, effectively disallowing the process to observe itself.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33986

Details

Provenance
kibAuthored on Jan 21 2022, 3:29 PM
Reviewer
emaste
Differential Revision
D33986: p_candebug(), p_cansee(): always allow for curproc
Parents
rG3de96d664aaa: vm_pageout_scans: correct detection of active object
Branches
Unknown
Tags
Unknown