From: "wangliang (CI)" <wangliang74@huawei.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"idosch@nvidia.com" <idosch@nvidia.com>,
"kuniyu@amazon.com" <kuniyu@amazon.com>,
"stephen@networkplumber.org" <stephen@networkplumber.org>,
"dsahern@kernel.org" <dsahern@kernel.org>,
"lucien.xin@gmail.com" <lucien.xin@gmail.com>,
yuehaibing <yuehaibing@huawei.com>,
zhangchangzhong <zhangchangzhong@huawei.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 回复: [PATCH net v2] net: fix crash when config small gso_max_size/gso_ipv4_max_size
Date: Wed, 23 Oct 2024 07:18:32 +0000 [thread overview]
Message-ID: <c9abbcbe45e845a59869d01253db6dd0@huawei.com> (raw)
In-Reply-To: <CANn89iLpMv8E0=VR=nEBB_AJqR74=GbMvZs4NdESpCjBv7x7iA@mail.gmail.com>
Thank you very much for your suggestions!
-----邮件原件-----
发件人: Eric Dumazet <edumazet@google.com>
发送时间: 2024年10月23日 14:44
收件人: wangliang (CI) <wangliang74@huawei.com>
抄送: davem@davemloft.net; kuba@kernel.org; pabeni@redhat.com; idosch@nvidia.com; kuniyu@amazon.com; stephen@networkplumber.org; dsahern@kernel.org; lucien.xin@gmail.com; yuehaibing <yuehaibing@huawei.com>; zhangchangzhong <zhangchangzhong@huawei.com>; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
主题: Re: [PATCH net v2] net: fix crash when config small gso_max_size/gso_ipv4_max_size
On Wed, Oct 23, 2024 at 5:34 AM Wang Liang <wangliang74@huawei.com> wrote:
>
> Config a small gso_max_size/gso_ipv4_max_size will lead to an
> underflow in sk_dst_gso_max_size(), which may trigger a BUG_ON crash,
> because sk->sk_gso_max_size would be much bigger than device limits.
> Call Trace:
> tcp_write_xmit
> tso_segs = tcp_init_tso_segs(skb, mss_now);
> tcp_set_skb_tso_segs
> tcp_skb_pcount_set
> // skb->len = 524288, mss_now = 8
> // u16 tso_segs = 524288/8 = 65535 -> 0
> tso_segs = DIV_ROUND_UP(skb->len, mss_now)
> BUG_ON(!tso_segs)
> Add check for the minimum value of gso_max_size and gso_ipv4_max_size.
>
> Fixes: 46e6b992c250 ("rtnetlink: allow GSO maximums to be set on
> device creation")
> Fixes: 9eefedd58ae1 ("net: add gso_ipv4_max_size and gro_ipv4_max_size
> per device")
> Signed-off-by: Wang Liang <wangliang74@huawei.com>
> ---
Thanks for this fix !
Reviewed-by: Eric Dumazet <edumazet@google.com>
next prev parent reply other threads:[~2024-10-23 7:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 3:52 Wang Liang
2024-10-23 6:43 ` Eric Dumazet
2024-10-23 7:18 ` wangliang (CI) [this message]
2024-10-29 23:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c9abbcbe45e845a59869d01253db6dd0@huawei.com \
--to=wangliang74@huawei.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stephen@networkplumber.org \
--cc=yuehaibing@huawei.com \
--cc=zhangchangzhong@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®