You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
proxy: execInNetworkNamespace restores the MAIN thread's netns (/proc/self/ns/net), so a worker can get stuck inside a pod namespace — hypothesised source of #1007's cross-pod L4 landings; carry a thread-self patch + proof #1022
Hypothesis (from the #1007 attribution; strong, not yet proven)
Node-proxy outbound L4 connections to tcp-echo/mixed-svc sometimes land on the inbound :18008 listener of an unrelated pod on the same node (always the newest mesh pod there). Part (a), why the wrong listener wins, is #1007 (use_original_dst on the capture listener). Part (b), how a host-network node-proxy socket reaches a pod's capture listener at all, is this issue.
execInNetworkNamespace (source/common/network/utility.h ~383 at the pinned 726d7ac) records the namespace to return to by opening /proc/self/ns/net, which is the thread-group leader's (main thread's) namespace, not the calling thread's (setns(CLONE_NEWNET) is per-thread; /proc/thread-self/ns/net is the calling thread's). The main thread briefly enters pod namespaces all the time (health-check connects every 5 s per pod, listener creation). A worker that calls the helper during one of those instants "restores" itself into that pod's namespace and stays there until its next call. While stuck, its outbound sockets are created inside the pod's netns, redirect-all capture diverts them to that pod's capture listener, and #1007(a) hands them to the wrong inbound listener, which presents its own SVID and is correctly rejected (ssl_fail_verify_san).
Fits the data: ~1 burst per node per hour on both rev239 and rev242; HTTP rarely shows it because its upstream connections are pooled; every landing is the newest pod on the node. Not directly proven: the existing ExecInNetnsTest mocks open() so it cannot catch this.
Ask
Carry a patch under proxy/bazel/patches/ that uses /proc/thread-self/ns/net (fallback /proc/self/task/<tid>/ns/net on kernels without thread-self), with a unit test that runs the helper from a non-main thread while the main thread sits in another namespace and asserts the worker returns to ITS OWN namespace (red on today's code). Upstream handling is the maintainer's call (do not comment on envoyproxy/envoy from automation).
Prove or refute on talos: with the patch, the "TCP-floor connections on pods that serve no raw-TCP port" counter must go to zero (today non-zero on svc-1..5, prober, k6, udp-dialer). If it persists, something else moves node-proxy sockets into pod namespaces.
Confirmed on talos rev244 (aether 1.0.2-e632768, proxy pin with the #1028 thread-self patch, proxy generation started 00:41Z 2026-09-28).
Proof signal after 2 h 05 min (00:41–02:46Z), read as the runbook says (raw counters of the new generation; Envoy exports a counter series only once it has moved, which the rev243 generation confirmed: the three stray series appeared only after their first hit):
signal
unpatched rev243 generation (22:53–00:39Z, 1 h 47 min)
patched rev244 generation (00:41–02:46Z, 2 h 05 min)
TCP-floor downstream_cx on pods that serve no raw-TCP port
6 (prober pods: w03 3, w05 2, w04 1)
0 (no such series exists; the tcp-echo floors on w03/w04/w05 carry their normal ~6,000 cx, so the family is live)
ssl_fail_verify_san on tcp-echo / mixed-svc clusters
1 (w03)
0
inbound_ssl_connection_error on any pod's inbound
(not read)
0
At the unpatched rate (≈3.4 landings/h fleet) the patched window should have held ≈7; the probability of seeing none by chance is about 0.1 %. The worker-thread namespace leak was the source of the cross-pod L4 landings. The 8 h soak gate in e2e/soak/README.md (zero-reading gates table) keeps watching it.
Upstream: the fix is the two-line /proc/thread-self/ns/net change plus test/common/network/exec_in_netns_thread_test.cc in the carried patch; filing it is the maintainer's call. #980 tracks dropping the carried copy once a plain pin has it. Closing.
Activity
proxy: execInNetworkNamespace restores the calling THREAD's netns (/p…
proxy: carry a patch making execInNetworkNamespace restore the callin…
bpalermo commentedon Sep 28, 2026
Confirmed on talos rev244 (aether 1.0.2-e632768, proxy pin with the #1028 thread-self patch, proxy generation started 00:41Z 2026-09-28).
Proof signal after 2 h 05 min (00:41–02:46Z), read as the runbook says (raw counters of the new generation; Envoy exports a counter series only once it has moved, which the rev243 generation confirmed: the three stray series appeared only after their first hit):
downstream_cxon pods that serve no raw-TCP portssl_fail_verify_sanon tcp-echo / mixed-svc clustersinbound_ssl_connection_erroron any pod's inboundAt the unpatched rate (≈3.4 landings/h fleet) the patched window should have held ≈7; the probability of seeing none by chance is about 0.1 %. The worker-thread namespace leak was the source of the cross-pod L4 landings. The 8 h soak gate in
e2e/soak/README.md(zero-reading gates table) keeps watching it.Upstream: the fix is the two-line
/proc/thread-self/ns/netchange plustest/common/network/exec_in_netns_thread_test.ccin the carried patch; filing it is the maintainer's call. #980 tracks dropping the carried copy once a plain pin has it. Closing.fix(capture): stop use_original_dst handing diverted connections to w…