Page MenuHomeFreeBSD

Some TCP reassembly improvements
AcceptedPublic

Authored by jtl on Jul 27 2018, 5:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 2:35 AM
Unknown Object (File)
Thu, Mar 28, 10:03 PM
Unknown Object (File)
Mar 19 2024, 11:24 AM
Unknown Object (File)
Mar 17 2024, 11:32 AM
Unknown Object (File)
Mar 15 2024, 2:42 PM
Unknown Object (File)
Mar 15 2024, 8:35 AM
Unknown Object (File)
Mar 13 2024, 8:36 AM
Unknown Object (File)
Jan 25 2024, 6:19 AM

Details

Reviewers
rrs
tuexen
gnn
bz
Group Reviewers
transport
Summary

Some reassembly code improvements:

  • Coalesce 0-byte segments.
  • KASSERT that the TCP stack isn't trying to add an old segment, and that our reassembly queue doesn't start with an old segment.
  • Belt-and-suspenders: make sure there is no possible way that we can add the stack variable anywhere but the head of the queue. (Its too dangerous to not be paranoid in this area.)

The impetus for this was a bug found in a TCP stack during development testing. The bug caused the TCP stack to add a stale segment to the queue, and also to add a bunch of duplicate 0-byte segments. Eventually, it added the stack entry, which caused a panic.

Test Plan

I conducted the following testing:

  • Ran INVARIANTS kernel, which triggered and showed a bug in a TCP stack.
  • Sent a large number of 0-byte segments and saw that the reassembly queue did not grow.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Jul 27 2018, 6:19 PM

D16626 expanded on these changes and was recently committed. I believe we can close this one out.

D16626 expanded on these changes and was recently committed. I believe we can close this one out.

Maybe. I don't think @rrs has plans to MFC his changes. I may do this as a direct commit to stable/11 and stable/10.

bz added a subscriber: bz.

The functional changes seem fine even though they address multiple independent problems and should probably be fixed in two independent commits?