Page MenuHomeFreeBSD

tcp: Two bugs in rack one of which can lead to a panic.
ClosedPublic

Authored by rrs on Sep 22 2021, 7:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 3:50 AM
Unknown Object (File)
Tue, Nov 12, 9:22 PM
Unknown Object (File)
Sun, Nov 3, 6:08 AM
Unknown Object (File)
Sat, Oct 26, 3:56 PM
Unknown Object (File)
Sep 22 2024, 7:46 PM
Unknown Object (File)
Aug 26 2024, 10:41 AM
Unknown Object (File)
Aug 13 2024, 5:03 AM
Unknown Object (File)
Aug 13 2024, 5:03 AM
Subscribers

Details

Summary

In extensive testing in NF we have found two issues inside
the rack stack.

  1. An incorrect offset is being generated by the fast send path when a fast send is initiated on the end of the socket buffer and before the fast send runs, the sb_compress macro adds data to the trailing socket. This fools the fast send code into thinking the sb offset changed and it miscalculates a "updated offset". It should only do that when the mbuf in question got smaller.. i.e. an ack was processed. This can lead to a panic deref'ing a NULL mbuf if that packet is ever retransmitted. At the best case it leads to invalid data being sent to the client which usually terminates the connection. The fix is to have the proper logic (that is in the rsm fast path) to make sure we only update the offset when the mbuf shrinks.
  1. The other issue is more bothersome. The timestamp check in rack needs to use the msec timestamp when comparing the timestamp echo to now. It was using a microsecond timestamp which ends up giving error prone results but causes only small harm in trying to identify which send to use in RTT calculations if its a retransmit.

Diff Detail

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