From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org, jv@jvosburgh.net,
haiyangz@microsoft.com, ast@kernel.org, hawk@kernel.org,
john.fastabend@gmail.com, sdf@fomichev.me, bpf@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 0/5] net: make xdp config checks effective vs netif_xdp_propagate()
Date: Thu, 12 Nov 2026 15:50:22 -0800 [thread overview]
Message-ID: <20261112235027.4072149-1-kuba@kernel.org> (raw)
Bonding (and netvsc) try to auto-propagate XDP programs down
to their lower devices. These programs were installed directly
with .ndo_bpf and not recorded in struct net_device of the lowers.
This makes all the config checks for features incompatible with XDP
ineffective - HDS, memory providers etc. use dev_xdp_prog_count()
and do not call down to the driver to ask it whether it has XDP
installed.
Record the state appropriately. dev_xdp_prog_count() will now
"see" the propagated programs.
The issue was discovered when reworking HW-GRO and XDP interactions.
I was trying to make sure HW-GRO is reliably disabled with XDP,
and discovered we have a way to bypass all checks with bonding.
Not treating this as a fix since it's admin-only self-inflicted
damage that nobody is reporting being bothered by in real life.
Jakub Kicinski (5):
net: don't safety-check device features for XDP uninstall
net: move dev_xdp_set_link() and dev_xdp_set_prog() up
net: record XDP programs propagated to lower devices
selftests/bpf: check XDP attach on a nested bond slave
selftests/bpf: check replacing and detaching XDP on a bond through a
link
.../networking/net_cachelines/net_device.rst | 1 +
include/linux/netdevice.h | 7 +
drivers/net/bonding/bond_main.c | 4 +-
drivers/net/hyperv/netvsc_bpf.c | 2 +-
drivers/net/hyperv/netvsc_drv.c | 5 +-
net/core/dev.c | 133 ++++++++++++------
.../selftests/bpf/prog_tests/xdp_bonding.c | 120 +++++++++++++++-
7 files changed, 224 insertions(+), 48 deletions(-)
--
2.56.0
next reply other threads:[~2026-11-12 23:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 23:50 Jakub Kicinski [this message]
2026-11-12 23:50 ` [PATCH net-next 1/5] net: don't safety-check device features for XDP uninstall Jakub Kicinski
2026-11-12 23:50 ` [PATCH net-next 2/5] net: move dev_xdp_set_link() and dev_xdp_set_prog() up Jakub Kicinski
2026-11-12 23:50 ` [PATCH net-next 3/5] net: record XDP programs propagated to lower devices Jakub Kicinski
2026-11-12 23:50 ` [PATCH net-next 4/5] selftests/bpf: check XDP attach on a nested bond slave Jakub Kicinski
2026-11-12 23:50 ` [PATCH net-next 5/5] selftests/bpf: check replacing and detaching XDP on a bond through a link Jakub Kicinski
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=20261112235027.4072149-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=haiyangz@microsoft.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jv@jvosburgh.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
/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