Page MenuHomeFreeBSD

Some TCP reassembly improvements
AcceptedPublic

Authored by jtl on Jul 27 2018, 5:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 10:34 AM
Unknown Object (File)
Nov 12 2024, 3:44 PM
Unknown Object (File)
Nov 11 2024, 7:17 AM
Unknown Object (File)
Nov 10 2024, 11:53 AM
Unknown Object (File)
Nov 10 2024, 2:44 AM
Unknown Object (File)
Nov 8 2024, 6:44 PM
Unknown Object (File)
Nov 8 2024, 3:16 AM
Unknown Object (File)
Apr 8 2024, 2:35 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?