Skip to content

actornet: pin the sysctls a sandbox namespace inherits from the node - #3310

Merged
Eitan Yarmush (EItanya) merged 1 commit into
agent-substrate:mainfrom
BenTheElder:actornet-sandbox-sysctls
Oct 27, 2026
Merged

Eitan Yarmush (EItanya) merged 1 commit into
agent-substrate:mainfrom
BenTheElder:actornet-sandbox-sysctls

Conversation

@BenTheElder

Copy link
Copy Markdown
Collaborator

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_redirects
  • route_localnet
  • rp_filter
  • accept_local
  • accept_source_route
  • ... and has IPv6 on with accept_ra=1.

NOTE: 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.

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.

  • Tests pass
  • Docs updated

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]>

@bowei Bowei Du (bowei) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@EItanya Eitan Yarmush (EItanya) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

me as well

@EItanya
Eitan Yarmush (EItanya) added this pull request to the merge queue Oct 27, 2026
@thockin Tim Hockin (thockin) added this to the M3 milestone Oct 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 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 SetSysctls write 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

Merged via the queue into agent-substrate:main with commit c57124f Oct 27, 2026
5 checks passed
@BenTheElder
Benjamin Elder (BenTheElder) deleted the actornet-sandbox-sysctls branch October 27, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/network area/security Security related issue/pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable IP forwarding in actor sandbox network namespaces

5 participants