]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf: Fix possible incorrect IPv6 fragmentation
authorKristof Provost <kp@FreeBSD.org>
Thu, 20 Apr 2017 09:05:53 +0000 (09:05 +0000)
committerKristof Provost <kp@FreeBSD.org>
Thu, 20 Apr 2017 09:05:53 +0000 (09:05 +0000)
commit00eab743abca6918aca3ad165c1707ab70f7037f
treef8af0fb573c6fae92e372d3beeea9f74ff1b4998
parentd1025db49eef93340911de3807b622f8dd3edea1
pf: Fix possible incorrect IPv6 fragmentation

When forwarding pf tracks the size of the largest fragment in a fragmented
packet, and refragments based on this size.
It failed to ensure that this size was a multiple of 8 (as is required for all
but the last fragment), so it could end up generating incorrect fragments.

For example, if we received an 8 byte and 12 byte fragment pf would emit a first
fragment with 12 bytes of payload and the final fragment would claim to be at
offset 8 (not 12).

We now assert that the fragment size is a multiple of 8 in ip6_fragment(), so
other users won't make the same mistake.

Reported by: Antonios Atlasis <aatlasis at secfu net>
MFC after: 3 days
sys/netinet6/ip6_output.c
sys/netpfil/pf/pf_norm.c