Re: [PATCH net v2] ieee802154: 6lowpan: validate fragment offset against datagram size
From: Ryan Prinz
Date: Mon Nov 23 2026 - 08:43:20 EST
Thanks again, these are correct, and I've made the adjustments.
- [High] Zero-length fragments: agreed, the new check doesn't reject
skb->len == 0. lowpan_get_cb() only checks !skb->len on the FRAG1
branch, and that check runs before lowpan_rx_h_ipv6() pulls the
dispatch byte, so a FRAG1 whose only payload is that byte, or a
FRAGN carrying nothing but its header, both reach
lowpan_frag_queue() empty. Adding !skb->len to the bounds check, and
dropping the "a zero-length final fragment is accepted" wording from
the commit message. It shouldn't be accepted, and won't be.
- [Medium] Commit message mechanism: agreed, and it follows from your
next point. Reworded the impact description to stop asserting one
specific mechanism (the overlap-eviction splice), since that isn't
reliable given the issue below. The new wording just states what the
fix itself guarantees: no out-of-range or empty fragment is accepted
into the queue.
- [High, pre-existing] end = d_size passed to inet_frag_queue_insert()
instead of the fragment's own offset + skb->len: confirmed by
tracing both of your examples against the actual insert logic. This
predates this patch and isn't something this bounds-check patch
should carry. I'm tracking it as a separate issue to address on its
own rather than folding it in here.
v4 incoming with the zero-length check added and the commit message
reworded to not overstate the mechanism.
pw-bot: cr