Repository navigation
actornet: pin the sysctls a sandbox namespace inherits from the node - #3310
Merged
Eitan Yarmush (EItanya) merged 1 commit intoOct 27, 2026
Merged
Eitan Yarmush (EItanya) merged 1 commit into
Eitan Yarmush (EItanya) merged 1 commit into
Conversation
besides forwarding, a new namespace picks up the node's accept_redirects, route_localnet, rp_filter, accept_local and accept_source_route, and its links take IPv6 router advertisements and redirects from the actor. pin them SetSysctls now writes every key, since turning forwarding off sets conf/all/accept_redirects back to 1 the sysctls are set before any link is added, a conf/default write doesn't reach existing links for keys the node set explicitly Signed-off-by: Benjamin Elder <[email protected]>
Benjamin Elder (BenTheElder)
requested review from
Eitan Yarmush (EItanya) and
Bowei Du (bowei)
October 27, 2026 14:56
Eitan Yarmush (EItanya)
approved these changes
Oct 27, 2026
Eitan Yarmush (EItanya)
left a comment
Collaborator
There was a problem hiding this comment.
me as well
There was a problem hiding this comment.
🔵 Needs a closer look
Security-sensitive, kernel-dependent networking changes need human review and privileged test validation on supported kernels for both runtime paths.
No open issues 🎉
What changed in this PR
Hardens actor sandbox networking by explicitly setting inherited namespace sysctls before creating links, covering both gVisor and microVM paths.
Changes:
- Pins forwarding, redirect, source-validation, and IPv6 settings before link creation.
- Makes
SetSysctlswrite every key in order so earlier writes cannot invalidate skipped settings. - Adds tests for explicit writes and per-link settings, including links added after setup.
| File | Description |
|---|---|
internal/netns/sysctl.go |
Writes all requested sysctls in order while preserving remount handling. |
internal/netns/sysctl_linux_test.go |
Updates batch-write tests and checks writes of already-matching values. |
internal/ateworker/actornet/sandbox.go |
Applies sandbox sysctls before creating network links. |
internal/ateworker/actornet/sandbox_linux_test.go |
Checks namespace and per-link settings for both sandbox layouts. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why is this needed? (Or link the issue. Open one first for features, API, install or CI changes.)
FYI Greg Castle (@destijl), follow-up on #2939 (comment)
Besides forwarding, a new namespace picks up the node's:
accept_redirectsroute_localnetrp_filteraccept_localaccept_source_routeaccept_ra=1.NOTE:
SetSysctlsnow writes every key, since turning forwarding off setsconf/all/accept_redirectsback to 1.The sysctls are set before any link is added, a conf/default write doesn't reach existing links for keys the node set explicitly.
Fixes #2939
AI use: Assisted with identifying the gaps (with upstream sources cited), drafting the change and testing. I read through this before submitting and iterated a bit.