HomeFreeBSD

frag6: prevent overwriting initial fragoff=0 packet meta-data.

Description

frag6: prevent overwriting initial fragoff=0 packet meta-data.

When we receive the packet with the first fragmented part (fragoff=0)
we remember the length of the unfragmentable part and the next header
(and should probably also remember ECN) as meta-data on the reassembly
queue.
Someone replying this packet so far could change these 2 (3) values.
While changing the next header seems more severe, for a full size
fragmented UDP packet, for example, adding an extension header to the
unfragmentable part would go unnoticed (as the framented part would be
considered an exact duplicate) but make reassembly fail.
So do not allow updating the meta-data after we have seen the first
fragmented part anymore.

The frag6_20 test case is added which failed before triggering an
ICMPv6 "param prob" due to the check for each queued fragment for
a max-size violation if a fragoff=0 packet was received.

MFC after: 3 weeks
Sponsored by: Netflix

Details

Provenance
bzAuthored on
Parents
rS354052: Use THREAD_CAN_SLEEP() macro to check if thread can sleep. There is no
Branches
Unknown
Tags
Unknown