Skip to content

Commit 5e39de8

Browse files
Jianguo Wugregkh
authored andcommitted
udp: using datalen to cap max gso segments
commit 158390e 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: bec1f6f ("udp: generate gso with UDP_SEGMENT") Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/900742e5-81fb-30dc-6e0b-375c6cdd7982@163.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 666521b commit 5e39de8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/ipv4/udp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,
899899
kfree_skb(skb);
900900
return -EINVAL;
901901
}
902-
if (skb->len > cork->gso_size * UDP_MAX_SEGMENTS) {
902+
if (datalen > cork->gso_size * UDP_MAX_SEGMENTS) {
903903
kfree_skb(skb);
904904
return -EINVAL;
905905
}

0 commit comments

Comments
 (0)