HomeFreeBSD

cr_canseejailproc(): New privilege, no direct check for UID 0

Description

cr_canseejailproc(): New privilege, no direct check for UID 0

Use priv_check_cred() with a new privilege (PRIV_SEEJAILPROC) instead of
explicitly testing for UID 0 (the former has been the rule for almost 20
years).

As a consequence, cr_canseejailproc() now abides by the
'security.bsd.suser_enabled' sysctl and MAC policies.

Update the MAC policies Biba and LOMAC, and prison_priv_check() so that
they don't deny this privilege. This preserves the existing behavior
(the 'root' user is not restricted, even when jailed, unless
'security.bsd.suser_enabled' is not 0) and is consistent with what is
done for the related policies/privileges (PRIV_SEEOTHERGIDS,
PRIV_SEEOTHERUIDS).

Approved by: re (gjb)
Reviewed by: emaste (earlier version), mhorne
Sponsored by: Kumacom SAS
Differential Revision: https://reviews.freebsd.org/D40626

(cherry picked from commit 7974ca1cdbee949f5e453eea112be265b425c407)
(cherry picked from commit bedaf8af51c96cef025c13c41ba420163824e8cb)

Details

Provenance
olceAuthored on Aug 17 2023, 11:54 PM
mhorneCommitted on Oct 18 2023, 5:59 PM
Reviewer
emaste
Differential Revision
D40626: cr_canseejailproc(): New privilege, no direct check for UID 0
Parents
rG1ffcc2983834: pmcstat: fix duplicate event allocation on CPU 0
Branches
Unknown
Tags
Unknown