]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r317186
authorkp <kp@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 23 Apr 2017 08:59:57 +0000 (08:59 +0000)
committerkp <kp@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 23 Apr 2017 08:59:57 +0000 (08:59 +0000)
commit8c0eb827937a45ed14192e0c0a1ee6c7cb2c1f22
treefb3d8d846c0ee1df35e21d6cc7ca74249a778390
parent3412589de335ac155c07714b26ffef6f5dbdb5a7
MFC r317186

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>

git-svn-id: svn://svn.freebsd.org/base/stable/10@317335 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/netinet6/ip6_output.c
sys/netpfil/pf/pf_norm.c