]> git.baikalelectronics.ru Git - kernel.git/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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Aug 2022 12:16:48 +0000 (13:16 +0100)
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>
net/core/skbuff.c

index 974bbbbe7138a447e04d3a773d8c875574413516..5ea1d074a920b389b456a34748f906fd411daf76 100644 (file)
@@ -4205,9 +4205,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;
                }