This is a note to let you know that I've just added the patch titled udp: using datalen to cap max gso segments to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: udp-using-datalen-to-cap-max-gso-segments.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 158390e45612ef0fde160af0826f1740c36daf21 Mon Sep 17 00:00:00 2001 From: Jianguo Wu <wujianguo@xxxxxxxxxxxxxxx> Date: Wed, 8 Dec 2021 18:03:33 +0800 Subject: udp: using datalen to cap max gso segments From: Jianguo Wu <wujianguo@xxxxxxxxxxxxxxx> commit 158390e45612ef0fde160af0826f1740c36daf21 upstream. The max number of UDP gso segments is intended to cap to UDP_MAX_SEGMENTS, this is checked in udp_send_skb(): if (skb->len > cork->gso_size * UDP_MAX_SEGMENTS) { kfree_skb(skb); return -EINVAL; } skb->len contains network and transport header len here, we should use only data len instead. Fixes: bec1f6f69736 ("udp: generate gso with UDP_SEGMENT") Signed-off-by: Jianguo Wu <wujianguo@xxxxxxxxxxxxxxx> Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx> Link: https://lore.kernel.org/r/900742e5-81fb-30dc-6e0b-375c6cdd7982@xxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/ipv4/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -845,7 +845,7 @@ static int udp_send_skb(struct sk_buff * kfree_skb(skb); return -EINVAL; } - if (skb->len > cork->gso_size * UDP_MAX_SEGMENTS) { + if (datalen > cork->gso_size * UDP_MAX_SEGMENTS) { kfree_skb(skb); return -EINVAL; } Patches currently in stable-queue which might be from wujianguo@xxxxxxxxxxxxxxx are queue-5.4/udp-using-datalen-to-cap-max-gso-segments.patch