Unverified Commit 75b662fc authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13062 net: test for not too small csum_start in virtio_net_hdr_to_skb()

parents 4e75c234 b972f58e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -103,8 +103,10 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,

		if (!skb_partial_csum_set(skb, start, off))
			return -EINVAL;
		if (skb_transport_offset(skb) < nh_min_len)
			return -EINVAL;

		nh_min_len = max_t(u32, nh_min_len, skb_transport_offset(skb));
		nh_min_len = skb_transport_offset(skb);
		p_off = nh_min_len + thlen;
		if (!pskb_may_pull(skb, p_off))
			return -EINVAL;