freebsd-src/sys/security
Olivier Certner 7974ca1cdb 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).

Reviewed by:            emaste (earlier version), mhorne
MFC after:              2 weeks
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40626
2023-09-28 11:42:22 -03:00
..
audit sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
mac sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
mac_biba cr_canseejailproc(): New privilege, no direct check for UID 0 2023-09-28 11:42:22 -03:00
mac_bsdextended sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_ddb mac_ddb: Fix the show rman validator. 2022-08-12 10:20:05 -07:00
mac_grantbylabel Add mac_grantbylabel 2023-08-24 17:42:11 -07:00
mac_ifoff sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_ipacl mac_ipacl: Use IfAPI 2023-08-25 12:50:39 -04:00
mac_lomac cr_canseejailproc(): New privilege, no direct check for UID 0 2023-09-28 11:42:22 -03:00
mac_mls sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_none sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_ntpd sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_partition sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_pimd sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_portacl sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_priority
mac_seeotheruids sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_stub sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_test sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_veriexec mac_veriexec ensure label fields are initialized 2023-07-06 09:26:15 -07:00
mac_veriexec_parser sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00