Commit d923b977 authored by Felix Fietkau's avatar Felix Fietkau Committed by Zhang Changzhong
Browse files

udp: fix receiving fraglist GSO packets

mainline inclusion
from mainline-v6.11-rc5
commit b128ed5ab27330deeeaf51ea8bb69f1442a96f7f
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAKQ33
CVE: CVE-2024-43817

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b128ed5ab27330deeeaf51ea8bb69f1442a96f7f



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

When assembling fraglist GSO packets, udp4_gro_complete does not set
skb->csum_start, which makes the extra validation in __udp_gso_segment fail.

Fixes: 89add40066f9 ("net: drop bad gso csum_start and offset in virtio_net_hdr")
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20240819150621.59833-1-nbd@nbd.name


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Conflicts:
	net/ipv4/udp_offload.c
[commit 30b03f2a0592 ("udp: Fall back to software USO if IPv6 extension
headers are present")]
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parent a50c1e59
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -275,7 +275,8 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
		return ERR_PTR(-EINVAL);

	if (unlikely(skb_checksum_start(gso_skb) !=
		     skb_transport_header(gso_skb)))
		     skb_transport_header(gso_skb) &&
		     !(skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST)))
		return ERR_PTR(-EINVAL);

	if (skb_gso_ok(gso_skb, features | NETIF_F_GSO_ROBUST)) {