Skip to content

Commit

Permalink
net/core/skbuff: Check the return value of skb_copy_bits()
Browse files Browse the repository at this point in the history
[ Upstream commit c624c58 ]

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>
  • Loading branch information
FloridSleeves authored and gregkh committed Sep 15, 2022
1 parent 7308520 commit a62701d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/core/skbuff.c
Expand Up @@ -4179,9 +4179,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;
}
Expand Down

0 comments on commit a62701d

Please sign in to comment.