Page MenuHomeFreeBSD

tcp: improve segment validation in SYN-RECEIVED
ClosedPublic

Authored by tuexen on Thu, Oct 2, 7:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 3:43 PM
Unknown Object (File)
Sat, Oct 11, 2:45 PM
Unknown Object (File)
Thu, Oct 9, 12:27 PM
Unknown Object (File)
Thu, Oct 9, 12:25 PM
Unknown Object (File)
Thu, Oct 9, 12:25 PM
Unknown Object (File)
Thu, Oct 9, 11:56 AM
Unknown Object (File)
Sun, Oct 5, 1:03 PM
Unknown Object (File)
Fri, Oct 3, 7:50 AM

Details

Summary

There validation of SEG.SEQ (first step in SEGMENT ARRIVES) should be done before the validation of SEG.ACK (fifth step in SEGMENT ARRIVES). Furthermore, when the SEG.SEQ validation fails, a challenge ACK should be sent instead of sending a RST-segment and moving the endpoint to CLOSED.

Thanks to Tilnel for reporting the issue on freebsd-net@.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tuexen requested review of this revision.Thu, Oct 2, 7:59 AM
This revision is now accepted and ready to land.Thu, Oct 2, 1:57 PM
jtl added inline comments.
sys/netinet/tcp_syncache.c
1284

This has a race condition in that it reads from sc after unlocking sch. IIUC, that means sc could have been freed by another thread by the time we run the log line. I think this same race is present on line 1209.

sys/netinet/tcp_syncache.c
1284

See D52868.