HardenedBSD/sys/security
Li-Wen Hsu 7937bfbc0c
mac_do(4): Enhance GID rule validation to check all groups in cr_groups
Previously, the rule validation only checked the primary GID (cr_gid).
This caused issues when applying GID-based rules, as users with matching
secondary groups were not considered valid. This patch modifies both
functions to iterate through all groups in cr_groups to ensure all group
memberships are considered when validating GID-based rules.

For example, a user's primary group is staff (20) and they are also in
the wheel (0) group, this change allows the rule gid=0:any to enable
them to run commands as any user.

Reviewed by:	delphij (earlier version), bapt
Differential Revision:	https://reviews.freebsd.org/D47304
2024-10-29 02:58:12 +08:00
..
audit
mac MAC: improve handling of listening sockets 2024-09-26 08:06:24 +02:00
mac_biba
mac_bsdextended
mac_ddb
mac_do mac_do(4): Enhance GID rule validation to check all groups in cr_groups 2024-10-29 02:58:12 +08:00
mac_grantbylabel procfs require PRIV_PROC_MEM_WRITE to write mem 2024-09-19 13:10:27 -07:00
mac_ifoff
mac_ipacl
mac_lomac
mac_mls
mac_none
mac_ntpd
mac_partition
mac_pimd
mac_portacl
mac_priority
mac_seeotheruids
mac_stub
mac_test
mac_veriexec procfs require PRIV_PROC_MEM_WRITE to write mem 2024-09-19 13:10:27 -07:00
mac_veriexec_parser mac_veriexec_parser: Fix open_file error handling 2024-09-20 09:22:56 -06:00