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)
Jan 14 2024, 9:08 AM
Unknown Object (File)
Dec 20 2023, 3:24 AM
Unknown Object (File)
Sep 21 2023, 4:31 PM
Unknown Object (File)
Aug 12 2023, 11:26 AM
Unknown Object (File)
Jun 23 2023, 3:36 PM
Unknown Object (File)
Jun 21 2023, 1:31 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.