diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6841e61a6bd0b66e7b1df0545697604479c6b7a1..23a25dc505a7992d61609cc68dbcd0894892f983 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1115,6 +1115,14 @@ static void skb_release_data(struct sk_buff *skb, enum skb_drop_reason reason) goto free_head; } + if (shinfo->nr_frags > MAX_SKB_FRAGS) { + pr_err("nr_frags=%u\n", shinfo->nr_frags); + DEBUG_NET_WARN_ON_ONCE(shinfo->nr_frags > MAX_SKB_FRAGS); + } + if (shinfo->nr_frags && !skb->data_len) { + pr_err("skb->data_len is zero but nr_frags=%u\n", shinfo->nr_frags); + DEBUG_NET_WARN_ON_ONCE(shinfo->nr_frags && !skb->data_len); + } for (i = 0; i < shinfo->nr_frags; i++) __skb_frag_unref(&shinfo->frags[i], skb->pp_recycle);