git: kernel: Fix jail caps check bug in caps_priv_check()
Aaron LI
aly at crater.dragonflybsd.org
Wed Jul 22 07:03:09 PDT 2026
commit 4ef1a3af79d09d365d01f4b43e0797cb50987b1a
Author: Nathan Sapwell <nathan at dreamfast.solutions>
Date: Thu Jul 2 11:57:27 2026 +0000
kernel: Fix jail caps check bug in caps_priv_check()
caps_priv_check() reuses its cap parameter to hold the
group-shifted value before passing it to prison_priv_check(), so the
per-capability jail cases (SYSCAP_NONET_RAW, SYSCAP_NOMOUNT_*,
SYSCAP_NOMOUNT_PROCFS, etc.) are never evaluated. The group caps
SYSCAP_NONET / SYSCAP_NOMOUNT always return 0 in jail, so raw sockets
and null/tmp/dev/procfs mounts succeed inside a default-policy jail.
Fix the bug by using a separate local variable for the group check.
GitHub-PR: #44
Assisted-with: Zhipu GLM-5.2
Summary of changes:
sys/kern/kern_caps.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4ef1a3af79d09d365d01f4b43e0797cb50987b1a
--
DragonFly BSD source repository
More information about the Commits
mailing list