opnsense-src/sys/security
Olivier Certner ae2ee5470d
MAC/do: Remove the 'prison0' special cases in the common paths
The rules on 'prison0' are initialized in init(), now using
set_empty_rules().

Until the jail is destroyed, they can never be uninitialized by a call
to osd_jail_del(), since the only chain to call it is
mac_do_prison_set() -> remove_rules() -> osd_jail_del(), and
mac_do_prison_set() (method PR_METHOD_SET) can never be called on
'prison0'.  This guarantees that find_rules() always find a valid
'rules' pointer to return.

There's no need to do anything special in destroy() for 'prison0', as
osd_jail_deregister() now takes care of it.

Reviewed by:    bapt
Approved by:    markj (mentor)
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D47603

(cherry picked from commit beb5603c51)
2025-04-03 21:30:59 +02:00
..
audit audit/audit.c: fix typo KERNEL_PANICED->KERNEL_PANICKED 2025-02-08 02:26:56 +02:00
mac MAC: syscalls: mac_label_copyin(): 32-bit compatibility 2025-01-16 19:06:56 +01:00
mac_biba MAC: mac_biba, mac_lomac: Fix setting loader tunables 2025-02-13 18:19:56 +08:00
mac_bsdextended MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_ddb mac_ddb: Fix the show rman validator. 2022-08-12 10:20:05 -07:00
mac_do MAC/do: Remove the 'prison0' special cases in the common paths 2025-04-03 21:30:59 +02:00
mac_ifoff MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_ipacl MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_lomac MAC: mac_biba, mac_lomac: Fix setting loader tunables 2025-02-13 18:19:56 +08:00
mac_mls MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_none sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_ntpd MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_partition MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_pimd MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_portacl MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_priority MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_seeotheruids MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_stub MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_test MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_veriexec MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_veriexec_parser sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00