2022-08-23 05:51:45

by Li Zhong

[permalink] [raw]
Subject: [PATCH v1] 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 <[email protected]>
---
net/core/skbuff.c | 5 ++---
1 file 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 @@ 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;
}
--
2.25.1


2022-08-24 12:34:01

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH v1] net/core/skbuff: Check the return value of skb_copy_bits()

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

On Mon, 22 Aug 2022 22:44:11 -0700 you wrote:
> skb_copy_bits() could fail, which requires a check on the return
> value.
>
> Signed-off-by: Li Zhong <[email protected]>
> ---
> net/core/skbuff.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)

Here is the summary with links:
- [v1] net/core/skbuff: Check the return value of skb_copy_bits()
https://git.kernel.org/netdev/net/c/c624c58e08b1

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html