From: Aaron Conole <aconole@redhat.com>
To: Kyuwon Cho <kyuwoncho18@gmail.com>
Cc: Eelco Chaudron <echaudro@redhat.com>,
Ilya Maximets <i.maximets@ovn.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, dev@openvswitch.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: openvswitch: don't WARN on a non-IP packet that needs fragmenting
Date: Thu, 19 Nov 2026 09:08:17 -0500 [thread overview]
Message-ID: <f7twlq8hq26.fsf@aconole-thinkpadt14gen4.rmtusnh.csb> (raw)
In-Reply-To: <179502509517.2983267.1652158471891914135@gmail.com> (Kyuwon Cho's message of "Wed, 18 Nov 2026 10:06:09 -0800 (PST)")
Kyuwon Cho <kyuwoncho18@gmail.com> writes:
> ovs_fragment() only handles IPv4 and IPv6 and drops any other packet
> with a WARN_ONCE(). Since OVS_PACKET_CMD_EXECUTE takes the MRU from
> userspace, any ethertype can get there, e.g. an MPLS packet executed by
> an unprivileged user in its own user and network namespace:
>
> Failed fragment ->ovs0: eth=8847, MRU=500, MTU=1500.
> WARNING: net/openvswitch/actions.c:831 at ovs_fragment+0x239/0x840, CPU#1: test/106
> Call Trace:
> do_execute_actions+0x580e/0x7380
> ovs_execute_actions+0xd3/0x3e0
> ovs_packet_cmd_execute+0xc21/0x13c0
>
> The packet is dropped either way, so use a rate-limited warning instead.
>
> Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
> Closes: https://lore.kernel.org/netdev/179492834266.3639154.14679778183890331729@gmail.com/
> Signed-off-by: Kyuwon Cho <kyuwoncho18@gmail.com>
> ---
> Aaron, here is the patch, with the rate-limited warning you suggested.
> It was written with LLM assistance; we reviewed and tested it. With it
> applied on net, the reproducer from the report prints the message
> instead of warning.
Thanks - it makes sense to me. We could consider pr_warn_once instead
if preserving the 'only log once' semantic is important. I guess the
intent here was to let developers know that there was a really
misbehaving ovs-vswitchd process going on. Given it can be triggered by
an arbitrary user on many distributions, it would hide that - so I think
net_warn_ratelimited makes sense to call instead.
As a follow on, it's worth consideration to change the mru check to only
submit packets that can be handled. That's a bigger lift since we might
want to change that action to preserve the drop reason
(OVS_DROP_FRAG_INVALID_PROTO) when we get the 'asked to fragment a
packet that does not make sense'. Alternatively, we could drop it
entirely and just take the PKT_TOO_BIG drop path. After all, we know we
can't fragment it, and that the link won't forward it. For now,
Reviewed-by: Aaron Conole <aconole@redhat.com>
> net/openvswitch/actions.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index 12e339cbf791..bf3f2b328b53 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
> @@ -828,9 +828,9 @@ static void ovs_fragment(struct net *net, struct vport *vport,
> ip6_fragment(net, skb->sk, skb, ovs_vport_output);
> refdst_drop(orig_dst);
> } else {
> - WARN_ONCE(1, "Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.",
> - ovs_vport_name(vport), ntohs(key->eth.type), mru,
> - vport->dev->mtu);
> + net_warn_ratelimited("Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.\n",
> + ovs_vport_name(vport), ntohs(key->eth.type),
> + mru, vport->dev->mtu);
> reason = OVS_DROP_FRAG_INVALID_PROTO;
> goto err;
> }
next prev parent reply other threads:[~2026-11-19 14:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 15:12 [BUG] net: openvswitch: WARN_ONCE in ovs_fragment() reachable with a user-supplied MRU on a non-IP packet Kyuwon Cho
2026-11-18 17:39 ` Aaron Conole
2026-11-18 18:06 ` [PATCH net] net: openvswitch: don't WARN on a non-IP packet that needs fragmenting Kyuwon Cho
2026-11-19 14:08 ` Aaron Conole [this message]
2026-11-23 15:26 ` Paolo Abeni
2026-11-23 15:30 ` 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=f7twlq8hq26.fsf@aconole-thinkpadt14gen4.rmtusnh.csb \
--to=aconole@redhat.com \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=echaudro@redhat.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=kyuwoncho18@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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®