From: lily Date: Tue, 23 Aug 2022 05:44:11 +0000 (-0700) Subject: net/core/skbuff: Check the return value of skb_copy_bits() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0b7058067eb8ec143f415a42d6909a28f166de5f;p=linux.git net/core/skbuff: Check the return value of skb_copy_bits() [ Upstream commit c624c58e08b15105662b9ab9be23d14a6b945a49 ] skb_copy_bits() could fail, which requires a check on the return value. Signed-off-by: Li Zhong Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 563848242ad33..3c193e7d4bc67 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4188,9 +4188,8 @@ normal: SKB_GSO_CB(nskb)->csum_start = skb_headroom(nskb) + doffset; } else { - skb_copy_bits(head_skb, offset, - skb_put(nskb, len), - len); + if (skb_copy_bits(head_skb, offset, skb_put(nskb, len), len)) + goto err; } continue; }