Page MenuHomeFreeBSD

tcp: fix counter leak for SYN_RCVD state when syncache_socket() fails
ClosedPublic

Authored by glebius on Dec 5 2022, 10:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 26 2024, 7:58 PM
Unknown Object (File)
Nov 27 2024, 5:29 AM
Unknown Object (File)
Nov 19 2024, 5:35 PM
Unknown Object (File)
Nov 19 2024, 10:37 AM
Unknown Object (File)
Nov 19 2024, 9:39 AM
Unknown Object (File)
Nov 19 2024, 9:31 AM
Unknown Object (File)
Nov 17 2024, 9:53 AM
Unknown Object (File)
Oct 3 2024, 7:57 PM
Subscribers

Details

Summary

The SYN_RCVD state count is tricky here due to default code path and TFO
being so different. In the default case the count is incremented when a
syncache entry is added to the the database in syncache_insert(). Later
when connection transitions from syncache entry to a socket in
syncache_expand(), this counter is inherited by the tcpcb. If socket or
tcpcb allocation failed in syncache_socket() failed the syncache_expand()
is responsible for decrement. In the TFO case the syncache entry is not
inserted into database and count of SYN_RCVD is first incremented in the
syncache_tfo_expand() after successful socket allocation. Thus, inside
syncache_socket() we can't tell whether we need to decrement in a case of
a failure or not. The caller is responsible for this book keeping.

Fixes: 07285bb4c22c026a50f69149d5dae03169b15fe4

Diff Detail

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

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Dec 14 2022, 3:32 AM
This revision was automatically updated to reflect the committed changes.