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)
Sat, Dec 28, 7:11 PM
Unknown Object (File)
Nov 21 2024, 1:53 PM
Unknown Object (File)
Nov 21 2024, 1:52 PM
Unknown Object (File)
Nov 21 2024, 1:52 PM
Unknown Object (File)
Nov 21 2024, 1:32 PM
Unknown Object (File)
Nov 19 2024, 6:46 PM
Unknown Object (File)
Nov 19 2024, 6:40 PM
Unknown Object (File)
Nov 19 2024, 4:43 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.