Skip to content

seccomp: do not cache a truncated BPF filter - #2342

Merged
kolyshkin merged 1 commit into
containers:mainfrom
giuseppe:oss-scanner-7
Oct 16, 2026
Merged

kolyshkin merged 1 commit into
containers:mainfrom
giuseppe:oss-scanner-7

Conversation

@giuseppe

Copy link
Copy Markdown
Member

seccomp_export_bpf() performs a single write() and reports success even when it is short (e.g. ENOSPC or RLIMIT_FSIZE), so a truncated filter could be stored in the seccomp cache and break later containers. Export the program into memory (seccomp_export_bpf_mem() when available, otherwise through a pipe) and write it with safe_write().

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-BHHFXZEI.

seccomp_export_bpf() performs a single write() and reports success
even when it is short (e.g. ENOSPC or RLIMIT_FSIZE), so a truncated
filter could be stored in the seccomp cache and break later containers.
Export the program into memory (seccomp_export_bpf_mem() when
available, otherwise through a pipe) and write it with safe_write().

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-BHHFXZEI.

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>

@kolyshkin kolyshkin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Also opened a fix to seccomp/libseccomp#505

@kolyshkin
kolyshkin enabled auto-merge October 16, 2026 19:41
@kolyshkin
kolyshkin merged commit 2e2e8ca into containers:main Oct 16, 2026
98 of 99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants