Page MenuHomeFreeBSD

Prevent underflows in tp->snd_wnd
ClosedPublic

Authored by jtl on Mar 13 2016, 5:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 28, 7:24 PM
Unknown Object (File)
Sun, Apr 28, 7:23 PM
Unknown Object (File)
Apr 7 2024, 5:35 AM
Unknown Object (File)
Mar 17 2024, 6:49 AM
Unknown Object (File)
Feb 28 2024, 10:50 AM
Unknown Object (File)
Feb 28 2024, 9:02 AM
Unknown Object (File)
Jan 19 2024, 10:15 PM
Unknown Object (File)
Dec 30 2023, 9:11 PM

Details

Summary

We can underflow tp->snd_wnd if the remote side ACKs more than tp->snd_wnd. That can happen when the remote side responds to a window probe by ACKing the one byte it contains.

Obtained from: Juniper Networks (earlier version)
Sponsored by: Juniper Networks
MFC after: 2 weeks

Test Plan

Run a test script that duplicates this behavior; ensure it passes.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jtl retitled this revision from to Prevent underflows in tp->snd_wnd.
jtl updated this object.
jtl edited the test plan for this revision. (Show Details)
jtl added reviewers: transport, hiren.

Though I generally agree with the overall idea, I am wondering whether we should discuss the larger question we talked about on email: Should the snd_wnd be decremented by number of bytes acked by the other end when we already get window information from the other end?

I'll start a discussion around this on transport@

You are right. Let's get this in while we wait for the better fix.

sys/netinet/tcp_input.c
2805 ↗(On Diff #14290)

There are 4 sbavail(&so->so_snd) calls in this 'if' block. Do you think we can improve here by making one call and storing that value for later use?

sys/netinet/tcp_input.c
2805 ↗(On Diff #14290)

sbavail() is an inline function call that is simply return (sb->sb_acc);. So, functionally, I think the compiler already treats these "calls" as simple variable accesses.

hiren edited edge metadata.

Seems okay to me but I'd let someone else also chime in.

sys/netinet/tcp_input.c
2805 ↗(On Diff #14290)

fair enough if that is the case.

This revision is now accepted and ready to land.Mar 16 2016, 6:54 PM

Any further comments/reviews? If I don't receive any, I'll plan to commit this on Monday.

This revision was automatically updated to reflect the committed changes.