Skip to content

netlink: deny socket families outside a small allowlist#40

Merged
congwang-mk merged 1 commit intomainfrom
socket-family-allowlist
May 6, 2026
Merged

netlink: deny socket families outside a small allowlist#40
congwang-mk merged 1 commit intomainfrom
socket-family-allowlist

Conversation

@congwang-mk
Copy link
Copy Markdown
Contributor

@congwang-mk congwang-mk commented May 6, 2026

Summary

  • Switches handle_socket from a AF_NETLINK-only special case to a tiny allowlist (AF_UNIX, AF_INET, AF_INET6, AF_NETLINK); everything else returns EAFNOSUPPORT. This closes off AF_ALG (Copy Fail / CVE-2026-31431 entry point), AF_PACKET, AF_VSOCK, AF_XDP, AF_TIPC, and the rest of the niche socket-family LPE surface in one place rather than chasing CVEs per family.
  • Two regression tests: af_alg_socket_blocked asserts the exact errno (97) that an attempted socket(AF_ALG, SOCK_SEQPACKET, 0) should see, mirroring Copy Fail's exact opener; niche_socket_families_blocked covers the broader class.
  • Pre-existing tests across network, port_remap, http_acl, landlock, seccomp_enforce (27+) all pass — AF_INET / AF_INET6 / AF_UNIX / AF_NETLINK paths are unaffected.

Test plan

  • cargo test -p sandlock-core --test integration -- netlink_virt (10/10)
  • cargo test -p sandlock-core --test integration -- network port_remap http_acl (27/27)

Signed-off-by: Cong Wang <cwang@multikernel.io>
@congwang-mk congwang-mk merged commit 1e51216 into main May 6, 2026
8 checks passed
@congwang-mk congwang-mk deleted the socket-family-allowlist branch May 6, 2026 22:53
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.

1 participant