BPF List
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Amaan Cheval <amaan.cheval@gmail.com>
Cc: <netdev@vger.kernel.org>, <joshwash@google.com>,
	<hramamurthy@google.com>, <andrew+netdev@lunn.ch>,
	<davem@davemloft.net>, <edumazet@kernel.org>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <ast@kernel.org>, <daniel@iogearbox.net>,
	<hawk@kernel.org>, <john.fastabend@gmail.com>, <sdf@fomichev.me>,
	<bpf@vger.kernel.org>, <willemb@google.com>,
	<jeroendb@google.com>, <pkaligineedi@google.com>,
	<nktgrg@google.com>, <jordanrhee@google.com>,
	<przemyslaw.kitszel@intel.com>, <debarghyak@google.com>,
	<treapking@google.com>
Subject: Re: [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a config change
Date: Thu, 3 Dec 2026 12:11:28 +0100	[thread overview]
Message-ID: <axFOYGzs9ZII4aGs@boxer> (raw)
In-Reply-To: <20261203061215.487858-1-amaan.cheval@gmail.com>

On Thu, Dec 03, 2026 at 11:42:13AM +0530, Amaan Cheval wrote:
> gve checks that the device configuration supports XDP on every ndo_bpf
> call, including the ones that remove a program or disable an AF_XDP
> zero-copy pool. Once the MTU has been raised past the XDP limit, removal
> is refused, which the core does not expect: netlink removal fails, and a
> bpf_link release leaves the program running in the driver.
> 
> Patch 1 runs the check only when a program is installed or a pool is
> enabled. The bug was reproduced and the
> fix tested on gVNIC in GQI-QPL mode (GCE n2-standard-4) on net and, as
> a backport, on Debian 13's 6.12.117, and in DQO-RDA mode
> (c3-standard-4) on net; reproduce.sh is at
> https://github.com/AmaanC/sticky-xdp
> The results on net were taken with both patches applied; patch 2 does
> not touch the removal paths. The 6.12.117 backport had patch 1 alone.
> 
> Patch 2 fixes a separate problem on the line patch 1 moves: the pool
> path passes an extack that is not valid for XDP_SETUP_XSK_POOL. It is
> latent with CONFIG_INIT_STACK_ALL_ZERO and was reproduced on a kernel
> built with CONFIG_INIT_STACK_ALL_PATTERN.
> 
> Other drivers avoid the first problem by running their checks only when
> a program is installed (mlx5, ice, veth), and by refusing an MTU change
> that an attached program cannot handle (those three, and i40e, ixgbe,
> igc). gve already refuses HW-GRO, header split and RX buffer size
> changes, and queue count changes that XDP cannot use, while a program is
> attached, but not an MTU change, and those guards do not cover a
> zero-copy pool that was enabled without a program: raising the queue
> counts then makes the pool disable fail in the same way. This series
> makes gve run its check only on install and pool enable, so that
> removal no longer depends on the configuration passing the XDP check.
> 
> Not changed by this series: gve still lets the MTU be raised past the
> XDP limit while a program is attached, and the GQI receive path runs
> the program only on frames that fit one buffer, so larger frames would
> reach the stack without it. That is a separate problem.
> 
> A removal can also still fail if gve cannot rebuild its queues in
> gve_adjust_config(), reached from gve_set_xdp(); that takes an
> allocation or device failure, not a configuration change, and is not
> addressed here.
> 
> Also not changed, both found by reading the code during review of this
> series and not reproduced:
> - gve_xsk_pool_disable() unmaps the pool before it stops the queue, so
>   a receive poll that is still running can use a pool whose device
>   pointer has been cleared. That needs a separate fix.
> - xp_assign_dev() and xp_disable_drv_zc() pass drivers an on-stack
>   struct netdev_bpf that is not zeroed, and idpf_xsk_pool_setup() also
>   reads extack from it. Zeroing it in the core would cover every
>   driver; patch 2 fixes gve on its own and does not depend on that.

Please let us go with core fix if you have identified such an issue
instead of addressing this on every vulnerable driver now...

> 
> Both were found with the help of an AI coding assistant, used
> interactively to read the driver and the XDP core, write the
> reproducers and run the tests; details are in each patch.
> 
> Amaan Cheval (2):
>   gve: do not verify the XDP configuration on program or pool removal
>   gve: do not pass extack to the XDP check on XSK pool setup
> 
>  drivers/net/ethernet/google/gve/gve_main.c | 23 ++++++++++++++++------
>  1 file changed, 17 insertions(+), 6 deletions(-)
> 
> 
> base-commit: ef3e21c61baa74e39a49b75318bd4541562ec43f
> -- 
> 2.47.3
> 
> 

      parent reply	other threads:[~2026-12-03 11:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  6:12 [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a config change Amaan Cheval
2026-12-03  6:12 ` [PATCH net 1/2] gve: do not verify the XDP configuration on program or pool removal Amaan Cheval
2026-12-03  6:12 ` [PATCH net 2/2] gve: do not pass extack to the XDP check on XSK pool setup Amaan Cheval
2026-12-03 11:11 ` Maciej Fijalkowski [this message]

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=axFOYGzs9ZII4aGs@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=amaan.cheval@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=debarghyak@google.com \
    --cc=edumazet@kernel.org \
    --cc=hawk@kernel.org \
    --cc=hramamurthy@google.com \
    --cc=jeroendb@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jordanrhee@google.com \
    --cc=joshwash@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nktgrg@google.com \
    --cc=pabeni@redhat.com \
    --cc=pkaligineedi@google.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sdf@fomichev.me \
    --cc=treapking@google.com \
    --cc=willemb@google.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