* [PATCH] udp: using datalen to cap max gso segments
@ 2021-12-08 10:03 Jianguo Wu
2021-12-08 14:58 ` Willem de Bruijn
2021-12-09 16:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jianguo Wu @ 2021-12-08 10:03 UTC (permalink / raw)
To: netdev; +Cc: willemb, davem
From: Jianguo Wu <wujianguo@chinatelecom.cn>
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@chinatelecom.cn>
---
net/ipv4/udp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 8bcecdd6aeda..23b05e28490b 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -916,7 +916,7 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,
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;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] udp: using datalen to cap max gso segments
2021-12-08 10:03 [PATCH] udp: using datalen to cap max gso segments Jianguo Wu
@ 2021-12-08 14:58 ` Willem de Bruijn
2021-12-09 16:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Willem de Bruijn @ 2021-12-08 14:58 UTC (permalink / raw)
To: Jianguo Wu; +Cc: netdev, davem
On Wed, Dec 8, 2021 at 5:03 AM Jianguo Wu <wujianguo106@163.com> wrote:
>
> From: Jianguo Wu <wujianguo@chinatelecom.cn>
>
> 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@chinatelecom.cn>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Thanks Jianguo
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] udp: using datalen to cap max gso segments
2021-12-08 10:03 [PATCH] udp: using datalen to cap max gso segments Jianguo Wu
2021-12-08 14:58 ` Willem de Bruijn
@ 2021-12-09 16:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-09 16:00 UTC (permalink / raw)
To: Jianguo Wu; +Cc: netdev, willemb, davem
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 8 Dec 2021 18:03:33 +0800 you wrote:
> From: Jianguo Wu <wujianguo@chinatelecom.cn>
>
> 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;
> }
>
> [...]
Here is the summary with links:
- udp: using datalen to cap max gso segments
https://git.kernel.org/netdev/net/c/158390e45612
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-09 16:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08 10:03 [PATCH] udp: using datalen to cap max gso segments Jianguo Wu
2021-12-08 14:58 ` Willem de Bruijn
2021-12-09 16:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox