Skip to content

seccomp: Use an allow-list for socket domains - #39

Open
vvoland wants to merge 2 commits into
moby:mainfrom
vvoland:seccomp-allowlist
Open

seccomp: Use an allow-list for socket domains#39
vvoland wants to merge 2 commits into
moby:mainfrom
vvoland:seccomp-allowlist

Conversation

@vvoland

@vvoland vvoland commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Replace the open-ended range checks with the Linux address families the default profile supports. AF_ALG and AF_VSOCK remain blocked, and unknown or future domains now receive the profile's default EPERM response.

@vvoland vvoland self-assigned this Aug 21, 2026
Replace the open-ended range checks with the Linux address families
the default profile supports. AF_ALG and AF_VSOCK remain blocked, and
unknown or future domains now receive the profile's default EPERM
response.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland
vvoland force-pushed the seccomp-allowlist branch from 4fac163 to f8d7350 Compare August 21, 2026 19:26
@thaJeztah

Copy link
Copy Markdown
Member

Quick LLM review; in case it could indeed be an option;

Do we need to expand the existing < AF_ALG rule into 37 equality rules? The security-relevant change is replacing the open-ended > AF_VSOCK rule. We could retain < AF_ALG and == AF_NFC, then explicitly allow only AF_KCM through AF_MCTP. That gives seven rules instead of 43, still blocks all future families from the current AF_MAX onward, and preserves the existing handling of AF_UNSPEC.
Apart from making the JSON substantially smaller, fewer conditional rules should also keep the generated multi-architecture BPF filter smaller.

@vvoland

vvoland commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Done.
FYI, I wanted to generalize this so it could produce multiple ranges, but we're limited to just one < rule because of: opencontainers/runc#2735

Comment thread seccomp/default_linux.go
Comment thread seccomp/default_linux_test.go Outdated
Comment thread seccomp/default_linux_test.go
@thaJeztah
thaJeztah requested a review from AkihiroSuda August 24, 2026 20:32
runc splits multiple comparisons on the same syscall argument into
separate rules, so bounded ranges become unions and can allow blocked
domains.

Use one less-than rule for the consecutive domains below AF_ALG. The
only additional value it matches is AF_UNSPEC, which is not a creatable
domain.
Keep higher domains as equality rules so AF_ALG, AF_VSOCK, and unknown
or future domains remain blocked. This reduces the generated socket
entries from 43 to seven.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland
vvoland force-pushed the seccomp-allowlist branch from 23ce641 to 65adc7e Compare August 25, 2026 15:45

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thaJeztah

Copy link
Copy Markdown
Member

@AkihiroSuda @djs55 PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

3 participants