]> git.itanic.dy.fi Git - linux-stable/commitdiff
net/core/skbuff: Check the return value of skb_copy_bits()
authorlily <floridsleeves@gmail.com>
Tue, 23 Aug 2022 05:44:11 +0000 (22:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 09:32:03 +0000 (11:32 +0200)
[ Upstream commit c624c58e08b15105662b9ab9be23d14a6b945a49 ]

skb_copy_bits() could fail, which requires a check on the return
value.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/skbuff.c

index 635cabcf8794f2131c84ea5cb0068ba47907ee39..7bdcdad58dc8663d2ff3a69ef70bd3f4122ff854 100644 (file)
@@ -3986,9 +3986,8 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
                                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;
                }