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)
Oct 4 2024, 1:41 PM
Unknown Object (File)
Oct 2 2024, 6:28 AM
Unknown Object (File)
Oct 1 2024, 2:15 PM
Unknown Object (File)
Sep 30 2024, 6:06 AM
Unknown Object (File)
Sep 30 2024, 3:55 AM
Unknown Object (File)
Sep 27 2024, 1:19 PM
Unknown Object (File)
Sep 27 2024, 4:24 AM
Unknown Object (File)
Sep 26 2024, 5:46 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.