BPF List
 help / color / mirror / Atom feed
* [PATCH RESEND 0/2] seccomp: Allow using `SECCOMP_MODE_STRICT` with `SECCOMP_MODE_FILTER`
@ 2026-05-26 15:32 Jamie Hill-Daniel
  2026-05-26 15:32 ` [PATCH RESEND 1/2] " Jamie Hill-Daniel
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Jamie Hill-Daniel @ 2026-05-26 15:32 UTC (permalink / raw)
  To: Kees Cook, Andy Lutomirski, Will Drewry, Shuah Khan
  Cc: linux-kernel, linux-kselftest, bpf, Jamie Hill-Daniel

This patch adjusts the logic used by seccomp to allow applying both
`SECCOMP_MODE_FILTER` and `SECCOMP_MODE_STRICT` to the same process.

Currently, once seccomp has been initialized, a process may not
transition to a different mode (only add additional filters).
This means that in container environments such as Docker, which by
default runs with `SECCOMP_MODE_FILTER`, processes may not enable
`SECCOMP_MODE_STRICT`. This is an obstacle to using applications
requiring `SECCOMP_MODE_STRICT` in these environments, and requires
disabling these security measures.

This patch introduces a new `SECCOMP_MODE_COMBINED` (used internally,
not exposed to userspace). When a process attempts to apply
`SECCOMP_MODE_FILTER` or `SECCOMP_MODE_STRICT`, this mode will be used
instead if the other mode is already enabled.

When subsequently running secure computing checks, we run the strict
checks followed by any installed filters.

Link: https://github.com/moby/moby/issues/42082

Signed-off-by: Jamie Hill-Daniel <jamie@hill-daniel.co.uk>
---
Jamie Hill-Daniel (2):
      seccomp: Allow using `SECCOMP_MODE_STRICT` with `SECCOMP_MODE_FILTER`
      selftest: seccomp: Adjust test for using both `STRICT` and `FILTER`

 kernel/seccomp.c                              | 46 +++++++++++++++------------
 tools/testing/selftests/seccomp/seccomp_bpf.c |  5 ++-
 2 files changed, 28 insertions(+), 23 deletions(-)
---
base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
change-id: 20260302-seccomp-combined-24bc3dbe32fd

Best regards,
-- 
Jamie Hill-Daniel <jamie@hill-daniel.co.uk>


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-06-15 23:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 15:32 [PATCH RESEND 0/2] seccomp: Allow using `SECCOMP_MODE_STRICT` with `SECCOMP_MODE_FILTER` Jamie Hill-Daniel
2026-05-26 15:32 ` [PATCH RESEND 1/2] " Jamie Hill-Daniel
2026-05-26 16:23   ` sashiko-bot
2026-06-12 19:25   ` Will Drewry
2026-06-12 21:24     ` Andy Lutomirski
2026-06-12 22:01       ` clubby789
2026-06-12 22:37         ` Andy Lutomirski
2026-06-12 22:58           ` clubby789
2026-06-12 22:37     ` clubby789
2026-06-12 22:50       ` Andy Lutomirski
2026-05-26 15:32 ` [PATCH RESEND 2/2] selftest: seccomp: Adjust test for using both `STRICT` and `FILTER` Jamie Hill-Daniel
2026-05-26 16:44   ` sashiko-bot
2026-06-13  4:14 ` [PATCH RESEND 0/2] seccomp: Allow using `SECCOMP_MODE_STRICT` with `SECCOMP_MODE_FILTER` Kees Cook
2026-06-15 16:23   ` Jamie Hill-Daniel
2026-06-15 22:38     ` Kees Cook
2026-06-15 23:16       ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox