Message ID | 20240515144313.61680-1-dracodingfly@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: Fix the gso BUG_ON that treat the skb which head_frag is true as non head_frag | expand |
dracoding wrote: > From: Fred Li <dracodingfly@gmail.com> > > The crashed kernel version is 5.16.20, and I have not test this patch > because I dont find a way to reproduce it, and the mailine may be > has the same problem. That is a pretty old kernel. There has been work in this space in the meantime. Such as commit 3dcbdb134f32 ("net: gso: Fix skb_segment splat when splitting gso_size mangled skb having linear-headed frag_list") or commit 9e4b7a99a03a ("net: gso: fix panic on frag_list with mixed head alloc types").
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 001152c..d805a47 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4070,7 +4070,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, hsize = skb_headlen(head_skb) - offset; - if (hsize <= 0 && i >= nfrags && skb_headlen(list_skb) && + if (hsize <= 0 && i >= nfrags && !list_skb->head_frag && skb_headlen(list_skb) && (skb_headlen(list_skb) == len || sg)) { BUG_ON(skb_headlen(list_skb) > len);