提交 6d819a14 编写于 作者: L lily 提交者: Jialin Zhang

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

stable inclusion
from stable-v5.10.143
commit 9d040a629e7e7965c70e3ff16e1a8180470b8746
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0U6

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9d040a629e7e7965c70e3ff16e1a8180470b8746

--------------------------------

[ Upstream commit c624c58e ]

skb_copy_bits() could fail, which requires a check on the return
value.
Signed-off-by: NLi Zhong <floridsleeves@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e3b6f567
...@@ -4063,9 +4063,8 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, ...@@ -4063,9 +4063,8 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
SKB_GSO_CB(nskb)->csum_start = SKB_GSO_CB(nskb)->csum_start =
skb_headroom(nskb) + doffset; skb_headroom(nskb) + doffset;
} else { } else {
skb_copy_bits(head_skb, offset, if (skb_copy_bits(head_skb, offset, skb_put(nskb, len), len))
skb_put(nskb, len), goto err;
len);
} }
continue; continue;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册