Files
freebsd/sys/security
Andrew Griffiths 3be409a395 mac_bsdextended: reject negative rule indices in sysctl_rule()
The security.mac.bsdextended.rules.<N> node handler takes N as
`index = name[0]` (a signed int) and only checks
`index >= MAC_BSDEXTENDED_MAXRULES`.  A negative index is caught on
the read branch, but the write-only add and delete
branches proceed to `rules[index]` unconditionally.

Reject `index < 0` alongside the existing upper-bound check.

Submitted by calif.io for the OpenAI Patch The Planet program

Signed-off-by: Andrew Griffiths <[email protected]>

Reviewed by:	markj
MFC after:	2 weeks

(cherry picked from commit 5d0b87669a)
2026-10-01 13:42:36 +00:00
..
2026-06-16 01:00:21 +00:00
2025-12-26 16:25:47 +08:00