Re: [PATCH net-next v2 1/4] net: fix skb->unreadable propagation in skb_split() and skb_shift()
From: Stanislav Fomichev
Date: Tue Nov 03 2026 - 17:44:00 EST
On 11/02, Mina Almasry wrote:
> skb_split() and skb_shift() do not accurately maintain skb->unreadable
> when moving fragments between skbs:
>
> - skb_split_inside_header() moves all fragments out of skb into skb1
> (leaving skb with nr_frags == 0 and only host-readable linear memory),
> but leaves skb->unreadable set on skb.
> - skb_split_no_header() unconditionally copies skb->unreadable to skb1
> even if 0 fragments were moved to skb1 (k == 0), and leaves
> skb->unreadable set on skb when splitting at skb_headlen(skb) moves
> all fragments into skb1 (!skb_shinfo(skb)->nr_frags).
> - skb_shift() neither propagates skb->unreadable to target skb when
> shifting unreadable fragments into an empty skb, nor clears
> skb->unreadable after all fragments are shifted out of skb.
>
> Fix all three cases so skb->unreadable accurately tracks whether the
> remaining fragments in each skb are unreadable.
>
> This issue is theoretical and was found by manual code inspection and
> LLM review; it was not triggered in production. Verified with the
> net_core KUnit test suite; not tested on real hardware.
>
> Fixes: 65249feb6b3d ("net: add support for skbs with unreadable frags")
> Signed-off-by: Mina Almasry <almasrymina@xxxxxxxxxx>
Acked-by: Stanislav Fomichev <sdf@xxxxxxxxxxx>