Skip to contentSkip to conversation

net/core/skbuff: Check the return value of skb_copy_bits()

PATCH Applied lily 2 participants 2 messages Aug 23, 2022 – Aug 24, 2022

Subsystems (2)
lore
Share & tools
lore

lily

author
#0 lore raw

PATCH 1/1 net/core/skbuff: Check the return value of skb_copy_bits()

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

---
 net/core/skbuff.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/core/skbuff.c +2 -3
index 974bbbbe7138..5ea1d074a920 100644
@@ -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;
 		}
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

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

Quoted 7 lines · On Mon, 22 Aug 2022 22:44:11 -0700 you wrote:

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

---
 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html