Article View: linux.kernel.netdev
Article #26304Re: [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a config change
From: Amaan Cheval
Date: Thu, 03 Dec 2026 11:45
Date: Thu, 03 Dec 2026 11:45
90 lines
16331 bytes
16331 bytes
On Thu, Dec 3, 2026 at 4:41 PM Maciej Fijalkowski <maciej.fijalkowski@intel.com> wrote: > > 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... > Makes sense, I'll respin patch 2 with the zero-initialisation in xp_assign_dev() and xp_disable_drv_zc() for the core fix instead of gve driver specifically. Thank you, Maciej! pw-bot: changes-requested > > > > 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 > > > >
Technical Details
Message-ID:
<CAG+wEg1CeCb61Ze=6CdtbQ-4Jd6847XikUZUdy7jhW6M-ASaFA@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376525-linux-kernel-netdev=dewy.ruReferences:
<20261203061215.487858-1-amaan.cheval@gmail.com> <axFOYGzs9ZII4aGs@boxer>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376525-linux-kernel-netdev=dewy.ru
From: amaan.cheval@gmail.com (Amaan Cheval)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a
config change
Date: Thu, 3 Dec 2026 17:15:19 +0530
Organization: Usenet Network
Message-ID: <CAG+wEg1CeCb61Ze=6CdtbQ-4Jd6847XikUZUdy7jhW6M-ASaFA@mail.gmail.com>
References: <20261203061215.487858-1-amaan.cheval@gmail.com> <axFOYGzs9ZII4aGs@boxer>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="2476108"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:2EdQb8xCk5Pgm/zU2M8X3KJsIzs= sha256:ljFMTgT3bvCsiSFX+sau9WscBxa+JG5yNGjoOv/iacA=
sha1:zam0YxjdGWAaxdzoaliLAesHQzQ= sha256:t3hn72W89XFckSZtCukhxhU2XY+enH5nPmjVcdDFraA=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id BBBB31178F3; Thu, 3 Dec 2026 14:45:48 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.697
X-Spam-Status: No, score=-1.697 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
URIBL_BLACK=1.7] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id CgRkfMbFjZkL;
Thu, 3 Dec 2026 14:45:45 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376525-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id A58B31178F2; Thu, 3 Dec 2026 14:45:36 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id 82DD2602DE2; Thu, 3 Dec 2026 11:45:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796298334;
b=n9Fy9sLprhdlM2NN/V1cOd+UtTWDnTu0Tx0PRfjCAzk2pRGHzSP2m+MxCUFI+RvhkclL
mIdIhX1n0blufVCu2v2fAE8Gkkgm4YN5eO/DRlYD1odMOeRPmh/2LW7Wc+WP2AV3kZ39+
tBQLlvFURgduq3M2L1Kaf1X88NeZ/sWCnfOHRDOSEhz0dhYHtrwCM8E5hspw1YprzhVmF
aHaNw4Ls2yht4akWGvDIqEchhIodbmN56sYEnMOkyDmwepBAYl9J+BR1WS27fQ2rBUosj
WVVEGCI6v3KpLwAhAh8dAnT0zDTwvVuAEQKjabQCCRnprmMMmHxYf1/MNi1ayoZ7Sqw==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796298334;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:References:
In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=50S820Ds430rbymsB0EVWy1E5syg/SZU/gV65u1zEPQ=;
b=SiVM2WIkzv4ulPIwxOF4TgKNTOI/1gA9NEd7a1x4Itz7U0MNz7MQLlZ5RDLUKDtcFVTZ
1F6faWqFTzIkxqJxLwEQC5a/V+chx/+6JZE2XIXR794ICGL5Pd5pOGfEpdYy/SckF8fby
GeG+FBp1Nvy1gjcbz3cy7mLt2kNFNaxkkb7Fa26qkrHn5Tva39d8v4TvO7gvO5Gm2YG8E
IwBOyv1WlcW0xhu6j8x599T+ceKuI5SVqrpXBxcrEPIKvGvSAVTfg6IHJTWX9UVk3sdaL
zgyE8Rf2fKOZSPPfZ3zEKqT9Bg9IkuFO98hPskuLqj3QHqo0D6NGRtQ9T5lhDYcKseA==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jo9c2uxs;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id D02BB606A33C;
Thu, 3 Dec 2026 11:45:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jo9c2uxs
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.167.175
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796298334;
b=KcFIWwl5z55dkP4ZBX5Pj/6haOJXIQuIFzCNHQSTxCLvDaCIdgDElwmsNDbfFWFSln8m
0vVfP+5ZAjIFKhIHWO8QGPUjWX1HmFDX1dVjO85CsLh338gYx3nTWALUUZms/IEUGJi+h
Wd9g+BI2Ku5pewt8VrMe03u6se8JP23sK6h/RHaB1ak4Dc/tr//DHY7L1NrTdDMNJrQ0F
jzAj2NF0fYnWf2gygSxUJ2wRqFn0HDzZae7qA6jNu48pq2mw0CxoahR/OhIysNnVN86yn
HB3iF5QBn7jGDwCZ7NwemBQlj/dvPh3oi6Hu1GnBO3+Kh5kYqJ143nQjDrxVUuDOF0g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796298334;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:MIME-Version:References:
In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=50S820Ds430rbymsB0EVWy1E5syg/SZU/gV65u1zEPQ=;
b=VQ+n5U4zUtWUwf+B+9ZAauRkuwwmW9VUpJLRJc5C+rfs4NIWcRvDTcaTocDwNQsmWY1s
d7soEAKdNcPXCHScR5apunlftelB89a+TR0Kkq8K5n/3OjD6DjPqUV2z2zKQ1mIK/OD3e
yXs54+qAMRySODXU5NttdUpuyKFfMRalNLKdUO4xA7+dFA62K1/pcPFp/fQGvkmBJMgwA
bpWw9c2l1tHEINhgkQ0o39fzO8U/OZNpkscJWLa6GwGL7cGghw6bevJ7JmrJ0kJSGmRWa
TS658D8yxT7bAK+PtSFPPp4qXMeOTxKz63agjmFZsRU8hNEzAwEWYpkD9OJpgmkN24g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jo9c2uxs;
arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.167.175
X-Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31B5A606A338
for <netdev@vger.kernel.org>; Thu, 3 Dec 2026 11:45:33 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 31B5A606A338
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-53ec9237600so6313019b6e.3
for <netdev@vger.kernel.org>; Thu, 03 Dec 2026 03:45:32 -0800 (PST)
X-ARC-Seal: i=1; a=rsa-sha256; t=1796298332; cv=none;
d=google.com; s=arc-20260327;
b=ZKhIVWiJAum4JrvM+wHOOCRZ/jEBCGJiI1vDQNdd1fALYz7xWDuYCsAbAWUXDB1WRW
DLggGuNXycRQaOUXpqiMXNCi6KtxaWZShSTa3M9+EtK+ce3wDvvJOqqzt8UBZ2gEQkQY
kesT2y/lpmW4US5BXu0P2+rKToBAvKqqZZldM4x5ArhLMXHmz0fR/EOOPASYtSJgj2yW
KV/HUJNutg8QDPg+/87ueQBDGuOZYG+Lo0/xIWMA1nyDxw2t8gsrZck8u+WP0ubzXHU5
z08QkXwhLBey1j0BRcH0ns+zI4s6XHAW5Alq1fiFgpGeQJt4QMfh3hZIscn/VJMRiLEx
trjQ==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:dkim-signature;
bh=50S820Ds430rbymsB0EVWy1E5syg/SZU/gV65u1zEPQ=;
fh=IFEueo3dx4dy/T1qG4q4+mORwr16t/pfeWQWjhudXdE=;
b=Cs+OnloIPw/vtYu30dUi34Dyew0IKVovwhhOHMxvnQGdm4MxDhw+IX90opg4EcJad8
SIXi4w04Eo1fZwvOFdZ8io21/2SX7Q9MaJkdg8RiXiaaT8MsMdbndMGVI9hS73IlQ/bw
+qYHtVNK5GlEbPbbuuQn+Pjsvh+kz2rH4SzsM4lNAzl3I5grN4/2ZHeka8gjmNxZgnbX
ew4UD3A2IzcUzBp+/D2HVaE7RCg89GUvwEDkewb6uJzffvXwYNPfAsvwTqO7f1Zti0bd
DLlWL43XQcXkUmdL58lXdJnqx4XKJy+vaMklM/hfzAhV9D+LZm7EQte80mIoUc6XpxlK
gtRg==;
darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796298332; x=1796903132; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=50S820Ds430rbymsB0EVWy1E5syg/SZU/gV65u1zEPQ=;
b=jo9c2uxs+t9Ez+FQw9mIbsgp2R2Hqlrexy74PiMHzn9MLT8iJ0RM1DTZq5wDB6s3oy
LXGtYX4gfFQram2t71fdMppsh3KReH0/V7cZn6mwj4APLpwm6fnPR1zRuXDWg+KUVP1L
Cbvm363dMTIRpg6sCdMqNbEH848OKoZONjf5FhWIZbGwvlkrzvOqknrkbbrY/bK8eB9x
z51XRFQxEL/K9kLyEIc1SaqoB1C3jvamFJZb0muE25DLPDZ6VFwGDB4ftT6AqP1xUBeO
ZtypdBJb29omSdZ4vVzA3xSygxUvRM9FmrIVD9kKFlZhb/gDvofUSVKR0kEWAq6vS9PP
Nbig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796298332; x=1796903132;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=50S820Ds430rbymsB0EVWy1E5syg/SZU/gV65u1zEPQ=;
b=eLltRCsSumYP3jT/rND2eY8iHvZz6H23UwkidF0qLKUmOo3MEHiz+CoAZyKI0NsF9O
HB6KAyEjlqqSfnfLI3pWlL5bKLcjJPb3g7Pf9BIgszSBDWxYu6V0/SIZKgBvlxS+XXd8
wHmgFHHOazOvqmB2JolqavuOVYD+y8b0HJcVBqR+OGOatoolg2g+/twmJFrZjKl0D4JB
bGdNhshVq+RYRB9Y+jxFdVUdlSFrtVD3LtoXRc4BRUG7/rC9ppn9GiFyJV8avOVzAyl4
qrA2fmd6mLCIhu0mQGIf5kHiTwzSBoZyhjoupw1gWJRBhNZeVlPlEvAcPHk6CoV3EHg2
Ex3A==
X-Gm-Message-State: APuU4Z8YMS5tHGQs+uHm1QvfaIY26HURLlnG/XSXESGOrKF0UbMDtX6v
+6iCCuH40Imd3MgEy5eb4Q/tEwr1sSpEEx0YDYOlpQMiO6VMnHwzvH8AaHHGz44ySGVQ9usixCL
e0O6/965u8DHh7LD7IvsCCBMe2zr4yUg=
X-Gm-Gg: AZFdTZe2IaTLrUKreGcPPYkqPuCjAOdMj48NSuFFyZKCNhwFpVhSGjMxPNlcsJ1jP1O
VX0Qo1roUYbikXfHic2lVypFmY3xGDSyJUD23NsbLc+6SQW0UqbSrI0IWN/+v4eG/+cR2+X84mR
sXb7OaChaNG2XM5VvhKBbg9LNlCbfJLnvk6YHRRD+KId3Vk/WcYfsrDCqkFuh0qKU0elmatjpag
3VSuBImpQ8DdyZpbOhxzOJAwYCs2APQ2H49fFsPZbjeL+K0kSsixvbY/8VwAhKLHpZems9ND9nc
hBWwidiBv9AImd1TUKOeGiEjyEnttbFt8QvV4dDOdzabTjd9sE58btWJV8KObuQFsL/4we9iNlN
5REMx5Veqr1hlK5Eg+BaoZJuGu8yavBMJCVbR7triaVEDGRK7Luylwwb2Gckt7eyn/DoQlg==
X-Received: by 2002:a05:6808:4f4c:b0:4f2:ac42:656b with SMTP id
5614622812f47-57a06d1a84cmr49501333b6e.7.1796298331895; Thu, 03 Dec 2026
03:45:31 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <axFOYGzs9ZII4aGs@boxer>
X-Gm-Features: Aa3M54pRWcxQGVhDpet4asxum5ILtzEF32SBQSJGQ7204jGcNWIxLN9bvNEImXc
X-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