🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26776

[PATCH net v2 0/2] gve, xsk: fix XDP removal after a config change and an uninitialized extack

#26776
From: Amaan Cheval
Date: Fri, 04 Dec 2026 06:28
76 lines
14772 bytes
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 GQI-QPL reproduce.sh run on net was repeated with the two patches of
this version applied. The DQO-RDA and pool disable results are from v1's
kernel, which had patch 1 and v1's gve change to the pool path; that
change did not touch the removal paths. The 6.12.117 backport had patch
1 alone. In all of the above, net is at
commit ef3e21c61baa ("net/tcp-ao: fix reset key lookup for IPv4
segments on IPv6 listeners"), the base of this series.

Patch 2 fixes a separate problem that gve hits on the line patch 1
moves: the XSK core passes drivers a struct netdev_bpf whose extack is
not initialized, and gve and idpf read it. It is latent with
CONFIG_INIT_STACK_ALL_ZERO and was reproduced on gve 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, 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.

That problem and the one patch 2 fixes 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.

v2:
- Patch 2 now initializes the struct in the XSK core, in xp_assign_dev()
  and xp_disable_drv_zc(), and replaces v1's gve-only change (Maciej).
- Patch 1 is unchanged.
v1: https://lore.kernel.org/netdev/20261203061215.487858-1-amaan.cheval@gmail.com/

Amaan Cheval (2):
  gve: do not verify the XDP configuration on program or pool removal
  xsk: initialize the struct netdev_bpf passed to ndo_bpf

 drivers/net/ethernet/google/gve/gve_main.c | 22 ++++++++++++++++------
 net/xdp/xsk_buff_pool.c                    |  4 ++--
 2 files changed, 18 insertions(+), 8 deletions(-)


base-commit: ef3e21c61baa74e39a49b75318bd4541562ec43f
-- 
2.47.3
Technical Details
Message-ID: <20261204062857.730993-1-amaan.cheval@gmail.com>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377114-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377114-linux-kernel-netdev=dewy.ru
From: amaan.cheval@gmail.com (Amaan Cheval)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 0/2] gve, xsk: fix XDP removal after a config change and an uninitialized extack
Date: Fri,  4 Dec 2026 11:58:55 +0530
Organization: Usenet Network
Message-ID: <20261204062857.730993-1-amaan.cheval@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2692473"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Oge27Thzn+nnyRrqCiGZYHrcnwc= sha256:WwvldNb8hRoI7++pPD2y3W2z7peMOO5bgZvEUKvHdNA=
	sha1:lFxS56unzAzYBe0MyQ47HRmcRaU= sha256:kQQdXEqi67T7h96ZGlIGRlTxGvgLcU350fXYb0YjaZU=
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 0B592117B2B; Fri,  4 Dec 2026 09:29:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.396
X-Spam-Status: No, score=-3.396 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_BLOCKED=0.001] 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 QcKZaguQ1dIx;
	Fri,  4 Dec 2026 09:29:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377114-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 67489117B13; Fri,  4 Dec 2026 09:29:23 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 3A0A123841; Fri,  4 Dec 2026 06:29:21 +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=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796365760;
	b=UHhd/NszzmjYpwDS73LNMBUhyOGu03SqN7k0HRrFIlOirB1r8PAe3s/N3c/BTz4Dolsz
	 RtOTb7CeGPFci33XrYUhwlZU8iIbG82Sg8UR9zMgZuFv8hfbpkaYeZSPjTHXGvKYWO2Ao
	 cpzphqKEPN7QUpG/YnFI/KTgOQtQhY9wp9dhEO5CKTzC0ma71BjrcXhxwJGs7QtUlOKMC
	 Q07Edc2s8iGTUlKuNr+iqp6Wq+SgLRKWTPErCRTT1jOfts0cjrHT7Z/cpWyrk5NrieMp7
	 kDQTkFkvGXEFXkgPfpE6mkbZKZrfE74UV6aa89VbShkMkbcIiVUpwh2yUCk31sVwT3A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796365760;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=vyvooAG8bEPptQqwokU9ZoWaTZr2IOMX9Psd0cbAPWo=;
	b=ZdhxaFhSAaDM94oWbS1Q/b8wn8rJoW+YTk/34lJqOweGsulAE5kAkvG0kMB4y98wxhip
	 3umg671PFahZ3zDJticV5g1WpOHJRhDRaxjgCusbRQPGOAcIN6tjPVqMbrzqS3Fuxcsr7
	 UKLEaZm9yLATfzSBHMSYgwBEcyhbvi0mmy3DRsHQVUGVssRFK41b0JqJbfJsO1DrqZJuT
	 F/dhUW5NZFpjUu2lHeLtuJsO3iH53wkq7n6ZksQxBsVqm6Y/Vd1wSJoAmDH7qsbJjGHGh
	 6T4j7FoANMz/N4g8oEsEY+mTTI4CV4LOkEV0BQBqYAjPWE94FESnoj31F1wtaBrdK8g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=x5NSPuzf;
	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 9C8E3606A339;
	Fri,  4 Dec 2026 06:29:20 +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=x5NSPuzf
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796365759;
	b=u+c/J9wlk91Hx6SMkkuF+wCHVPE6lf1WeJq+d3MQuMw8b9hBIa/76Ac9yYK12K8aOdqL
	 +Mf9Rm8z4kq46vJFysjLBCELZ/wKnOU+DHeyo8Rt/og4ylQdSgMg6QP+3MFV8CkJXZ279
	 crPaXsNyEUnM1VHBhLftxpRCJyrQJn7tfXWBI3r4KZaR4qhnfsAZV+sqrj06CtK5y8LNF
	 5DNQfv5exchYsw2e3gAQaxZIHRAPi3A9jtPECepn4WQlsfSzI3Jc0M2FG/DotMTFf3KiN
	 iEZDIbjRUKhnQKyRp1obkh8/ysXtY9F5MLqftOMgWS1tYZx8zUBapNzaAs7AI90p8NQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796365759;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=vyvooAG8bEPptQqwokU9ZoWaTZr2IOMX9Psd0cbAPWo=;
	b=KScEsYBN/as0mGsrOaQe2ateIzK+yXn1nss4RM4WPwKxrpkMkofDO8ChmRn8ppTSG5Gs
	 Fe56o1QJA9MHcBfzGYf+ec2063oCkwz4ScEDSWPZQrevSEamleppG/DEGc57pdjFAsIwR
	 QvXMR8DH9Cw6omwf8Heh8FE+0WApcVyqC2vYAdwOoPjlbtufJ8daSlGejAW/iy6Q+ORMJ
	 PCsW9mnJlbvWOdQ1d7PseIb3e7KEttIwM2rvTrPDOD8sFaJGhODdfnS+RzYaM7l5/aY7U
	 P5lT/2OyA8SbY8ZrjoRP/tyJsb2EdP0MNpllAkSjR9aP/IpIsfiZxjcOdMYg9g9aWpw==
X-ARC-Authentication-Results: i=1; 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=x5NSPuzf;
	arc=none smtp.remote-ip=74.125.82.45
X-Received: from mail-dl1-f45.google.com (mail-dl1-f45.google.com [74.125.82.45])
	(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 68B94606A322
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 06:29:19 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 68B94606A322
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-dl1-f45.google.com with SMTP id a92af1059eb24-1b5d5f12565so450485c88.1
        for <netdev@vger.kernel.org>; Thu, 03 Dec 2026 22:29:19 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796365758; x=1796970558; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=vyvooAG8bEPptQqwokU9ZoWaTZr2IOMX9Psd0cbAPWo=;
        b=x5NSPuzfBGDeguZwDGmI1AHLIjHSQOU3lPrh2VAR3iuuq+cFEM7lbyx27zjzv3cqef
         IXWRJDI2y1ZyTz/iDn79SqFhFySHNZICIdcjXkNmmEuhNfIcda7qoyQjRQ0rKUqqaNt0
         aDHnmghDNivyw3w9tGNNDOnF6omMka2z21XTFMpOBhvl1KVCWsZ1T9Xg6kA2ndZOqbpP
         VmwbHBZTljSHiH2F8OlD8+n+tsv2e1ZMDF90dki5d/tVg0QeoIZ4rM2X2/DxL41vmsTi
         Ienh7XhQi2tfTSR8TNUn92Wa8uFF3F4V1TquAK4pKKn8sZGyQjlkpGeg3RNRo0JPLqT4
         qc3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796365758; x=1796970558;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=vyvooAG8bEPptQqwokU9ZoWaTZr2IOMX9Psd0cbAPWo=;
        b=g/LzFZZf6ME/gKg5301jX+mg/lXtbnENEAPSq2+xMW1wduPDLDo2ev/9YE8XqOVzUj
         SA2/72smNMkDPix6q8gSjLgMDZTeVEU9ZhPH3kA/WgLBFvfrDrjqKNCbXEZSDWKFa7DN
         ZlMXxE3L4T3Wu+2PxJjn7grRTQ49WEfT8th9wf21oKKguSVAwvclUGdGKGaF87XUf6DA
         XvDtxdDUZn6+0HKrx3SjB5cRo1A1A7wOoGOnpUtXA33RTV7K5IUaN69oil5zQ8S7+95V
         XnD2XTvDmk6czhThzQEmC7+5rGyN9TLXlTt6Ih8exLXWePCA0M+sMsmEnI4ppgxEUo4a
         UOAQ==
X-Gm-Message-State: APuU4Z/n8EBqPa9o/vQTeIaJEQbqy23eYQeltPuuxH3ArvNtxY+3aqI5
	viqFsCnPUqjJD1Xf1OAx84PQFe7SQRexrXFJFtvvr3wmiA5PGqEnVt+VIlq9SxjA
X-Gm-Gg: AZFdTZcaf/euAEQ0A4B5R4+ReRVuMFosGb6PBScVQe8fmj71E1HaD9AOI4Ix65ROph8
	Da4wNMblmsn3YDdRdyVbpzbTB2gC1L2jd+91yoXBHFS/sELn2ikabJisYNOUn5heWnPM67Xuw8w
	o69yIEhTBKF7hBx8XHDjPFxF9/qGaoOaZWG1CifSiPktDTenF2CmY3nfwSErwcPCBlqcFr4XI8H
	dgnXu56pSdVSaHZQw92EHogsk9V129wg7SukYZjHfhRgQbibtn85ZNobYzf44GnIV8v6AYd/Ynh
	yAYqnoLL72Xf1siSJQOK0dsfTuxPpMfAes7NakfTZYqQ2ms0phSvu8wJrntJ7HvnRyWpCksY6sf
	r0YRX7QZ2m0WHbcQZovX7jPD1vDEBskv3iRK04fZRPfks8BOxm4WpvDliVzBT5FGuGBp2okp/Ar
	vek6/lF92wuDBLCq5mYlEgoNQad8oghQxJWRrUglnrphKXSsDUtLHKdr6HG+sepdNgRJnTBQ1LB
	3H1jkGwvfUUebb3ay60as4YbTVztLR2kOJK8/JeiySUAjPfklAY+xQdERIehnn37tH27JN7r8rb
	m2PBai52vcKXfhUER53bk55Tbn+h/4jW4jpFVXNy3tYiOWtiSzQjYopqYU9UkpKS1A==
X-Received: by 2002:a05:7022:ea8d:b0:1b5:8265:33a7 with SMTP id a92af1059eb24-1b5d7115820mr1188548c88.17.1796365758471;
        Thu, 03 Dec 2026 22:29:18 -0800 (PST)
X-Received: from localhost.localdomain ([2406:7400:51:44ac:c2b6:f9ff:fe77:10a0])
        by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5d63d04e7sm4447866c88.1.2026.12.03.22.29.09
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 03 Dec 2026 22:29:18 -0800 (PST)
X-Cc: 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,
	magnus.karlsson@intel.com,
	maciej.fijalkowski@intel.com,
	horms@kernel.org,
	michal.kubiak@intel.com,
	anthony.l.nguyen@intel.com,
	aleksander.lobakin@intel.com,
	Amaan Cheval <amaan.cheval@gmail.com>
X-Mailer: git-send-email 2.49.0
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