Page MenuHomeFreeBSD

tcp rack: fix switch to RACK when a FIN has already been sent
ClosedPublic

Authored by tuexen on Jul 6 2022, 1:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 2:11 PM
Unknown Object (File)
Jan 24 2024, 2:29 AM
Unknown Object (File)
Jan 20 2024, 7:24 AM
Unknown Object (File)
Jan 16 2024, 6:20 PM
Unknown Object (File)
Jan 14 2024, 10:23 AM
Unknown Object (File)
Dec 23 2023, 12:11 AM
Unknown Object (File)
Nov 2 2023, 9:48 PM
Unknown Object (File)
Sep 10 2023, 1:43 AM

Details

Summary

Fix the rack sendmap entry in case a FIN has been sent when the stack is switched over to RACK.

This issue was found by syzkaller.

Test Plan

Run the following packetdrill-script:

Diff Detail

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

Event Timeline

tuexen requested review of this revision.Jul 6 2022, 1:28 PM
sys/netinet/tcp_stacks/rack.c
12613

Should this assignment move into the else block below? rsm->r_end is written to again in the other branch.

sys/netinet/tcp_stacks/rack.c
12613

No. The code below will in a follow-up commit be changed to:

if (tp->snd_una == tp->iss)
    rsm->r_flags |= RACK_HAS_SYN;
rsm->r_start = tp->snd_una;

This is equivalent. I guess one should also add a condition which ensures that there hasn't been a wrap-around and SND.UNA is equal to ISS. This test can be based on the state of the TCP connection.
I plan to do that in a separate review once this change is in.

This revision is now accepted and ready to land.Jul 18 2022, 7:01 PM