Files
Andrew Griffiths 5d0b87669a 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
2026-09-16 15:34:31 +00:00
..
2026-07-07 04:25:08 +03:00