aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorlily <floridsleeves@gmail.com>2022-08-22 22:44:11 -0700
committerDavid S. Miller <davem@davemloft.net>2022-08-24 13:16:48 +0100
commitc624c58e08b15105662b9ab9be23d14a6b945a49 (patch)
treee1deb141dbb7593b362de15cec8744fed89b7e0a /net/core/skbuff.c
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec (diff)
downloadlinux-dev-c624c58e08b15105662b9ab9be23d14a6b945a49.tar.xz
linux-dev-c624c58e08b15105662b9ab9be23d14a6b945a49.zip
net/core/skbuff: Check the return value of skb_copy_bits()
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>
Diffstat (limited to 'net/core/skbuff.c')
-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 974bbbbe7138..5ea1d074a920 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -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;
}