File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 9090# Dangerous prctl(2) options — these allow a sandboxed process to
9191# weaken its own confinement.
9292PR_SET_DUMPABLE = 4 # re-enable /proc/pid/mem writes
93- PR_SET_SECCOMP_OPT = 22 # change seccomp mode from within sandbox
9493PR_SET_SECUREBITS = 28 # alter LSM security bits
9594PR_SET_PTRACER = 0x59616d61 # allow arbitrary ptrace attach
95+ # Note: PR_SET_SECCOMP is intentionally NOT blocked — seccomp filters
96+ # can only tighten (never loosen) when NO_NEW_PRIVS is set, and the
97+ # sandbox itself needs to stack filters via prctl(PR_SET_SECCOMP).
9698_DANGEROUS_PRCTL_OPS = (
9799 PR_SET_DUMPABLE ,
98- PR_SET_SECCOMP_OPT ,
99100 PR_SET_SECUREBITS ,
100101 PR_SET_PTRACER ,
101102)
Original file line number Diff line number Diff line change @@ -114,11 +114,11 @@ def test_prctl_in_syscall_map(self):
114114 assert "prctl" in _SYSCALL_NR
115115
116116 def test_dangerous_prctl_ops_defined (self ):
117- assert len (_DANGEROUS_PRCTL_OPS ) == 4
117+ assert len (_DANGEROUS_PRCTL_OPS ) == 3
118118 assert 4 in _DANGEROUS_PRCTL_OPS # PR_SET_DUMPABLE
119- assert 22 in _DANGEROUS_PRCTL_OPS # PR_SET_SECCOMP
120119 assert 28 in _DANGEROUS_PRCTL_OPS # PR_SET_SECUREBITS
121120 assert 0x59616d61 in _DANGEROUS_PRCTL_OPS # PR_SET_PTRACER
121+ assert 22 not in _DANGEROUS_PRCTL_OPS # PR_SET_SECCOMP — safe under NO_NEW_PRIVS
122122
123123
124124class TestBuildFilter :
You can’t perform that action at this time.
0 commit comments