multiport: carry a lost install race's counter to the surviving lane window

Two routines can race on a lane's first packet and derive a session each. Only
one gets installed, and the loser was dropped along with the replay-window entry
for the packet it had just accepted, leaving that one counter replayable.

The two sessions hold identical keys, so the winner's window is the same window
in every respect that matters: mark the counter seen on it instead. Closes the
gap without putting a lock on the decrypt path.
This commit is contained in:
Wade Simmons committed 2026-09-02 14:48:17 -04:00
1 parent 8c5c740571
commit e3efe0c53d
4 files changed
+31 -14

No files matched your search

+1 -1
View File
@@ -177,7 +177,7 @@ func (f *Interface) readOutsidePackets(via ViaSender, packet []byte, rxc *rxCont
if !laneCached {
// The packet decrypted, so the peer really is using this lane and the
// session we derived for it is worth keeping.
hostinfo.lanes.installSession(lane, ci)
hostinfo.lanes.installSession(f.l, lane, ci, h.MessageCounter)
}
// Roam before we respond, but only on the base tunnel: a lane's source