Merge pull request 'Issue 197: a physical link that is down is not filtered when it comes up' (#280) from jschoubben/every-physical-link-faces-outside into main
This commit was merged in pull request #280.
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
---
|
||||
status: resolved
|
||||
opened: 2026-10-02
|
||||
located-in: [mesh-host internal/outward (Links reported only the links carrying a default route)]
|
||||
fixed-by: mesh-host PR 66 (a link backed by a physical device is named outward, up or down), live 2026-10-02
|
||||
amended-design: []
|
||||
---
|
||||
|
||||
# 197 — A physical link that is down is not filtered when it comes up
|
||||
|
||||
## What was observed
|
||||
|
||||
A sweep of every machine's filter on 2026-10-02. A laptop-class machine connected by its radio has a
|
||||
wired port that was unplugged. Its filter guarded the radio and the tunnel, and accepted everything
|
||||
arriving on any other link:
|
||||
|
||||
```
|
||||
iifname != { "mesh0", "<radio>" } accept
|
||||
```
|
||||
|
||||
The wired port was not in the list. Plugged in, everything arriving on it would have been accepted,
|
||||
every port of the machine open to whatever network the cable reached. That would last until the
|
||||
machine reported again and was pushed a new filter.
|
||||
|
||||
## Why it matters
|
||||
|
||||
**The filter's one rule about links fails open.** [ADR 0140](../../02-DECISIONS/0140-the-filter-constrains-what-arrives-from-outside.md)
|
||||
has the filter constrain what arrives from outside, and has the machine say which links face outside.
|
||||
Everything not named is treated as the machine's own, its containers and bridges. So a link the machine
|
||||
fails to name is not filtered at all. The host named only the links carrying a default route at the
|
||||
moment it reported. A cable plugged in later is the ordinary case for a laptop. A second wired network
|
||||
that never carries the default route, such as a direct link to a storage box, is never named at all.
|
||||
|
||||
## Open questions
|
||||
|
||||
- A virtual link that faces outside (a VPN client's interface, a USB tether that appears as a virtual
|
||||
device) has no physical device behind it. It is named only while it carries the default route. Is
|
||||
that enough?
|
||||
|
||||
## Resolved (2026-10-02)
|
||||
|
||||
Live on the affected machine after the host was delivered and one more push: its filter now guards the
|
||||
radio, the tunnel and the unplugged wired port, before anything is plugged into it.
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
# Diagnosis
|
||||
|
||||
*2026-10-02.*
|
||||
|
||||
**Located in `mesh-host` `internal/outward`.** `Links` read the kernel's routing tables and returned the
|
||||
interfaces carrying a default route. An unplugged port carries none, so it was never reported, and the
|
||||
controller rendered the filter around the links it was given.
|
||||
|
||||
**The fix.** A link faces outside if it carries a default route **or** has a physical device behind it.
|
||||
The kernel lists every interface under `/sys/class/net`, with a `device` entry for one backed by
|
||||
hardware. A bridge, a veth, the tunnel and the loopback have none, so they stay the machine's own. The
|
||||
wired port is now reported up or down, and the filter guards it before anything is plugged in. Tested
|
||||
with a radio carrying the default route and an unplugged wired port beside a bridge, a veth, the docker
|
||||
bridge, the tunnel and the loopback: the two physical links are reported, nothing else.
|
||||
Reference in New Issue
Block a user