← Back to Pull requests

seccomp: allow socket(2) only for an allow-list of families #1324

Open
unknown opened this pull request with 196 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 05, 2026 10:48 UTC
Author

The default profile allowed socket(2) for every address family except AF_VSOCK, so any family the profile does not know about, such as AF_ALG, passes seccomp and relies on the LSM or the kernel config to be refused. Docker blocks AF_ALG deliberately.

Replace the catch-all allow rules with one allow rule per family, using the same list as moby/profiles (allowedSocketDomains). Families that are not listed now fail with ENOSYS, the profile default. AF_VSOCK keeps its explicit EPERM rule, and AF_NETLINK keeps the NETLINK_AUDIT restriction that depends on CAP_AUDIT_WRITE.

The allow rules compare the full 64-bit argument, so a value with the upper 32 bits set does not match and is denied, and no mask is needed.

This also makes socket and socketpair agree on which families they accept.

On ABIs that use socketcall(2) the arguments cannot be filtered by seccomp, so these rules apply to the direct socket and socketpair syscalls only. That limitation already existed and is unchanged.

Tested with podman and the regenerated seccomp.json: socket(AF_ALG) returned EACCES with the previous profile (SELinux) and EAFNOSUPPORT with SELinux labelling disabled, so seccomp did not stop it. It now returns ENOSYS. AF_UNIX, AF_INET, AF_INET6 and AF_NETLINK still work, NETLINK_AUDIT still needs CAP_AUDIT_WRITE, and AF_VSOCK is still EPERM.

Add tests for the allow-list and the NETLINK_AUDIT rule, and regenerate seccomp.json.

<!--- Please read the contributing guidelines before proceeding --->

Diff: 196 lines (+147 / -49) across 2 files Reviewer: ricardobranco777 Review duration: 17553m
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 196 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.316
Real PR Conversation Timeline
1 comments
"Review active on #1324"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.1% (MEDIUM) · Higher = larger blast radius
36.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19.2% · Safe to merge
19.2%