OPENAFS-SA-2017-001: rx: Sanity-check received MTU and twind values
commiteae2575dc738bd69bb6a0a84f87f02f5cf2b4eb9
authorBenjamin Kaduk <kaduk@mit.edu>
Mon, 4 Dec 2017 23:20:57 +0000 (4 17:20 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Tue, 5 Dec 2017 14:43:14 +0000 (5 08:43 -0600)
tree8b28adb655ea60e02cecfb5f0c05a65d4bdbec3b
parent352fbc811162fcdaa39cb7834475f40ba72fad11
OPENAFS-SA-2017-001: rx: Sanity-check received MTU and twind values

Rather than blindly trusting the values received in the
(unauthenticated) ack packet trailer, apply some minmial sanity checks
to received values.  natMTU and regular MTU values are subject to
Rx minmium/maximum packet sizes, and the transmit window cannot drop
below one without risk of deadlock.

The maxDgramPackets value that can also be present in the trailer
already has sufficient sanity checking.

Extremely low MTU values (less than 28 == RX_HEADER_SIZE) can cause us
to set a negative "maximum usable data" size that gets used as an
(unsigned) packet length for subsequent allocation and computation,
triggering an assertion when the connection is used to transmit data.

FIXES 134450

(cherry picked from commit 894555f93a2571146cb9ca07140eb98c7a424b01)

Change-Id: I98e2a65d1aa291a73e8cfed9c9eaac71c6af00dc
src/rx/rx.c