Page MenuHomeFreeBSD

tcp: Disallow connecting a disconnected socket
ClosedPublic

Authored by markj on Jun 16 2023, 3:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 29, 6:41 PM
Unknown Object (File)
Fri, Dec 12, 5:43 AM
Unknown Object (File)
Nov 27 2025, 3:21 AM
Unknown Object (File)
Nov 15 2025, 1:22 PM
Unknown Object (File)
Nov 15 2025, 12:23 PM
Unknown Object (File)
Nov 15 2025, 10:53 AM
Unknown Object (File)
Nov 15 2025, 3:54 AM
Unknown Object (File)
Nov 15 2025, 12:39 AM

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.