Skip to content

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

Merged
samuelkarp merged 1 commit into
containerd:mainfrom
vvoland:seccomp-allowlist
Sep 28, 2026
Merged

samuelkarp merged 1 commit into
containerd:mainfrom
vvoland:seccomp-allowlist

Conversation

@vvoland

@vvoland vvoland commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

The default profile allowed socket(2) through open-ended range checks around AF_ALG and AF_VSOCK. Any address family added to Linux later was allowed automatically.

List the Linux address families the default profile supports and build the socket rules from that list.

AF_ALG and AF_VSOCK stay blocked, and unknown or future domains now get the default EPERM response.

A single rule cannot bound both ends of a range, because runc treats repeated comparisons on one argument as OR.

The consecutive run starting at AF_UNIX therefore becomes one less-than rule, which is safe because AF_UNSPEC cannot be created. Every other domain gets its own equality rule.

This matches the same change in Moby's default seccomp profile.

The default profile allowed socket(2) through open-ended range checks
around AF_ALG and AF_VSOCK. Any address family added to Linux later was
allowed automatically.

List the Linux address families the default profile supports and build
the socket rules from that list.

AF_ALG and AF_VSOCK stay blocked, and unknown or future domains now get
the default EPERM response.

A single rule cannot bound both ends of a range, because runc treats
repeated comparisons on one argument as OR.

The consecutive run starting at AF_UNIX therefore becomes one less-than
rule, which is safe because AF_UNSPEC cannot be created. Every other
domain gets its own equality rule.

This matches the same change in Moby's default seccomp profile.

Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland self-assigned this Sep 28, 2026
Copilot AI lite review requested due to automatic review settings September 28, 2026 17:59
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Sep 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Updates the Linux seccomp default profile to allow only explicitly supported socket domains, blocking AF_ALG, AF_VSOCK, and future unknown domains.

Changes:

  • Adds an explicit socket-domain allow-list.
  • Generates optimized range and equality rules.
  • Adds tests for socket rule generation.
File Description
contrib/​seccomp/​seccomp_default.go Implements socket-domain allow-list rules.
contrib/​seccomp/​seccomp_default_test.go Tests generated socket rules and range handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@samuelkarp
samuelkarp added this pull request to the merge queue Sep 28, 2026
@samuelkarp samuelkarp added cherry-pick/2.2.x Change to be cherry picked to release/2.2 branch cherry-pick/2.3.x Change to be cherry picked to release/2.3 cherry-pick/2.4.x Change to be cherry picked to release/2.4 labels Sep 28, 2026
@samuelkarp

Copy link
Copy Markdown
Member

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@samuelkarp: once the present PR merges, I will cherry-pick it on top of release/2.2, release/2.3, release/2.4 in new PRs and assign them to you.

Details

In response to this:

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Merged via the queue into containerd:main with commit cf413d5 Sep 28, 2026
96 of 98 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Sep 28, 2026
@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@samuelkarp: new pull request created: #14247

Details

In response to this:

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@samuelkarp: new pull request created: #14248

Details

In response to this:

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@samuelkarp: new pull request created: #14249

Details

In response to this:

/cherry-pick release/2.4
/cherry-pick release/2.3
/cherry-pick release/2.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@samuelkarp samuelkarp added the cherry-pick/2.0.x Change to be cherry picked to release/2.0 branch label Sep 28, 2026
@samuelkarp

Copy link
Copy Markdown
Member

/cherry-pick release/2.0

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@samuelkarp: new pull request created: #14251

Details

In response to this:

/cherry-pick release/2.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@samuelkarp samuelkarp removed the cherry-pick/2.0.x Change to be cherry picked to release/2.0 branch label Sep 29, 2026
@samuelkarp samuelkarp added cherry-picked/2.0.x PR commits are cherry picked into the release/2.0 branch cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch cherry-picked/2.4.x PR commits are cherry picked into release/2.4 branch and removed cherry-pick/2.2.x Change to be cherry picked to release/2.2 branch cherry-pick/2.3.x Change to be cherry picked to release/2.3 cherry-pick/2.4.x Change to be cherry picked to release/2.4 labels Sep 29, 2026
@ricardobranco777

ricardobranco777 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

New releases should be made to avoid this same issue in Podman:
podman-container-tools/container-libs#1248

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

Labels

cherry-picked/2.0.x PR commits are cherry picked into the release/2.0 branch cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch cherry-picked/2.4.x PR commits are cherry picked into release/2.4 branch size/L

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants