From: Paolo Abeni <pabeni@redhat.com>
To: Hangbin Liu <hangbin.liu@linux.dev>,
Jay Vosburgh <jv@jvosburgh.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
Jussi Maki <joamaki@gmail.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net] bonding: check slave xdp_features in bond_xdp_xmit
Date: Fri, 4 Dec 2026 12:31:57 +0100 [thread overview]
Message-ID: <b8d8c7ff-1847-4f8b-8219-5f7d34560f7e@redhat.com> (raw)
In-Reply-To: <20261127-bond_xdp_xmit-v1-1-c2a7b622b95d@kylinos.cn>
On 11/27/26 04:08, Hangbin Liu wrote:
> From: Hangbin Liu <liuhangbin@kylinos.cn>
>
> bond_xdp_xmit() may select a slave that bond_enslave() made visible
> before bond_xdp_set_features() republished the bond's xdp_features.
> Frames enqueued in that window pass __xdp_enqueue()'s bond-level
> checks, and the bulk-queue flush later calls bond_xdp_xmit() without
> rechecking anything. The selected slave may be unable to transmit
> XDP frames:
>
> - NETDEV_XDP_ACT_NDO_XMIT appears only once the driver's XDP TX
> queues are up.
> - a linear-only slave receives multi-buffer frames enqueued while
> the bond still advertised NETDEV_XDP_ACT_NDO_XMIT_SG.
> - with no bond->xdp_prog, bond_enslave() skips the capability
> check: a slave without XDP joins while the bond still
> advertises NETDEV_XDP_ACT_NDO_XMIT (built from the other
> slaves; __xdp_enqueue() never looks at dev->xdp_prog) and
> bond_xdp_set_features() drops the flag only afterwards.
>
> Apply the __xdp_enqueue() contract to the selected slave at xmit
> time: require NETDEV_XDP_ACT_NDO_XMIT and, for fragmented frames,
> NETDEV_XDP_ACT_NDO_XMIT_SG, failing with -ENXIO otherwise (the
> caller frees the frames).
>
> Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver")
> Cc: stable@vger.kernel.org # b9d460c92455 ("bpf: devmap: check XDP features in __xdp_enqueue routine")
> Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
Given the 'broken from day-1' status, and the mostly theoretical
nature of the issue, I think this is net-next material.
/P
next prev parent reply other threads:[~2026-12-04 11:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 3:08 [PATCH net] bonding: check slave xdp_features in bond_xdp_xmit Hangbin Liu
2026-12-04 11:31 ` Paolo Abeni [this message]
2026-12-04 11:40 ` 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=b8d8c7ff-1847-4f8b-8219-5f7d34560f7e@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hangbin.liu@linux.dev \
--cc=hawk@kernel.org \
--cc=joamaki@gmail.com \
--cc=john.fastabend@gmail.com \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sdf@fomichev.me \
--cc=stable@vger.kernel.org \
/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