summaryrefslogtreecommitdiff
path: root/include/linux/virtio_net.h
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-10-07 14:54:21 +0100
committerMark Brown <broonie@kernel.org>2024-10-07 14:54:21 +0100
commit344190e0347324d95393c561a4b8c8dfa8cd628b (patch)
tree20d054b028d30ed361fbaeb20f319482e4a8312f /include/linux/virtio_net.h
parente4926ca0189dac2e780d6d3cca92052376fd7f0e (diff)
parent8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b (diff)
ASoC: Merge up v6.12
Fixes build issues with the KVM selftests
Diffstat (limited to 'include/linux/virtio_net.h')
-rw-r--r--include/linux/virtio_net.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 276ca543ef44..02a9f4dc594d 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -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;