Page MenuHomeFreeBSD

Some TCP reassembly improvements
AcceptedPublic

Authored by jtl on Jul 27 2018, 5:35 PM.

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
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

jtl created this revision.Jul 27 2018, 5:35 PM
tuexen accepted this revision.Jul 27 2018, 6:19 PM
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.

jtl added a comment.Aug 22 2018, 5:40 PM

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 accepted this revision.Aug 24 2018, 10:00 PM
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?