summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorlily <floridsleeves@gmail.com>2022-08-22 22:44:11 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-15 10:47:09 +0200
commita62701db411f3cbad13479101f4e2458ffff9e06 (patch)
treee23bc2e5c8014ae940d486c151bede72d6d6664d /net
parent73085208dd6b1a83bc38aa74d79efaa5741c3436 (diff)
downloadlinux-a62701db411f3cbad13479101f4e2458ffff9e06.tar.gz
linux-a62701db411f3cbad13479101f4e2458ffff9e06.tar.bz2
linux-a62701db411f3cbad13479101f4e2458ffff9e06.zip
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 <floridsleeves@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/skbuff.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index bebf58464d66..4b2b07a9422c 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4179,9 +4179,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;
}