Page MenuHomeFreeBSD

tcp: Disallow connecting a disconnected socket
ClosedPublic

Authored by markj on Jun 16 2023, 3:23 PM.
Tags
None
Referenced Files
F132113091: D40579.diff
Mon, Oct 13, 8:15 PM
Unknown Object (File)
Aug 21 2025, 9:12 AM
Unknown Object (File)
Aug 15 2025, 2:37 PM
Unknown Object (File)
Jul 4 2025, 5:03 PM
Unknown Object (File)
Jul 4 2025, 8:01 AM
Unknown Object (File)
Jul 1 2025, 4:04 AM
Unknown Object (File)
Jun 19 2025, 6:33 AM
Unknown Object (File)
Jun 12 2025, 4:49 PM

Details

Summary

Currently nothing prevents tcp_usr_connect() from attempting to connect
when the socket has been disconnected. At the moment, doing so triggers
an assertion in in_pcbconnect() because inp_faddr is not unspecified. I
believe this may have been caught in the past by TIMEWAIT checks, but
those are now removed.

Check for additional socket states in tcp_connect(). Add a regression
test for this case.

Reported by: syzbot+f0f7871ec5397602b446@syzkaller.appspotmail.com

Diff Detail

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

Event Timeline

markj requested review of this revision.Jun 16 2023, 3:23 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 23 2023, 3:10 PM
This revision was automatically updated to reflect the committed changes.