🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26166

[PATCH net 2/2] gve: do not pass extack to the XDP check on XSK pool setup

#26166
From: Amaan Cheval
Date: Thu, 03 Dec 2026 06:12
72 lines
14368 bytes
struct netdev_bpf only carries an extack for XDP_SETUP_PROG. For
XDP_SETUP_XSK_POOL, xp_assign_dev() fills in command, xsk.pool and
xsk.queue_id of an on-stack struct and nothing else, so xdp->extack is
whatever was on the stack.

Since commit 091a3b6ff2b9 ("gve: Use extack to log xdp config
verification errors") gve passes that pointer to
gve_verify_xdp_configuration(), which stores an error message through
it whenever the configuration is refused, for example when a zero-copy
socket is bound while the RX and TX queue counts do not allow XDP. With
CONFIG_INIT_STACK_ALL_ZERO the pointer is NULL and the message is
skipped; otherwise the driver writes to wherever the uninitialized
pointer points.

xp_disable_drv_zc() passes the same kind of struct when a pool is
disabled. gve ran the check on that path too until the commit "gve: do
not verify the XDP configuration on program or pool removal" removed
it, so a refused disable could also write through the pointer.

Pass NULL. The queue count refusal is still logged through
netdev_warn(); the other refusals are silent on this path.

Zeroing the struct in xp_assign_dev() and xp_disable_drv_zc() would
also fix this, and would cover idpf_xsk_pool_setup(), which reads
extack from it too. This patch fixes gve on its own so that the fix
does not depend on a change to the XSK core.

This was discovered by an AI code review agent reading gve_xdp() while
preparing "gve: do not verify the XDP configuration on program or pool
removal". It was reproduced, with that fix applied, on gVNIC in GQI-QPL
mode (GCE n2-standard-4) on net at commit ef3e21c61baa ("net/tcp-ao: fix
reset key lookup for IPv4 segments on IPv6 listeners"), built with
CONFIG_INIT_STACK_ALL_PATTERN, by binding a zero-copy AF_XDP socket at
the default queue counts and MTU 1460 with repro/xsk/xsk_trigger.c from
the Link below:

  # ./xsk_trigger eth0 0

  Oops: general protection fault, probably for non-canonical address 0xfefefefefefefefe: 0000 [#1] SMP NOPTI
  RIP: 0010:gve_verify_xdp_configuration.cold+0x1d/0x2e [gve]
  Call Trace:
   gve_xdp+0x47/0x4d0 [gve]
   xp_assign_dev+0x2c8/0x350
   xsk_bind+0x1ba/0x4e0

With this patch the same bind is refused with -EINVAL and no fault.

Link: https://github.com/AmaanC/sticky-xdp
Fixes: 091a3b6ff2b9 ("gve: Use extack to log xdp config verification errors")
Cc: stable@vger.kernel.org
Signed-off-by: Amaan Cheval <amaan.cheval@gmail.com>
---
 drivers/net/ethernet/google/gve/gve_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
index 5156259232b2..26b66a2c64b3 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -1868,7 +1868,8 @@ static int gve_xdp(struct net_device *dev, struct netdev_bpf *xdp)
 		if (!xdp->xsk.pool)
 			return gve_xsk_pool_disable(dev, xdp->xsk.queue_id);
 
-		err = gve_verify_xdp_configuration(dev, xdp->extack);
+		/* xdp->extack is only valid for XDP_SETUP_PROG */
+		err = gve_verify_xdp_configuration(dev, NULL);
 		if (err)
 			return err;
 		return gve_xsk_pool_enable(dev, xdp->xsk.pool,
-- 
2.47.3
Technical Details
Message-ID: <20261203061215.487858-3-amaan.cheval@gmail.com>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!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-376316-linux-kernel-netdev=dewy.ru
References: <20261203061215.487858-1-amaan.cheval@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!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-376316-linux-kernel-netdev=dewy.ru
From: amaan.cheval@gmail.com (Amaan Cheval)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 2/2] gve: do not pass extack to the XDP check on XSK pool setup
Date: Thu,  3 Dec 2026 11:42:15 +0530
Organization: Usenet Network
Message-ID: <20261203061215.487858-3-amaan.cheval@gmail.com>
References: <20261203061215.487858-1-amaan.cheval@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2192814"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wFF7fd6QBZv6YnTXSjWJ0M5PwN0= sha256:lmUwhyrOxMHr/eyWDm59SP21R/qbqD2LgH8NDqOV8Lo=
	sha1:dMcvzTPY4BEPpcFF7M66iBd71tA= sha256:MBsTtESzMMfu0hb8DBoqpj5RrnBLL0CoVtM1Z2b2UGc=
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 B1C7A117833; Thu,  3 Dec 2026 09:13:26 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-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 t3zpukcw2CeP;
	Thu,  3 Dec 2026 09:13:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376316-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 07B6111782E; Thu,  3 Dec 2026 09:13:15 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 313D6284BE; Thu,  3 Dec 2026 06:13:11 +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=1796278391;
	b=mla5RmkpW2W8WADGNR+7G5O29NcW2SxEbe51TsVuo4sSVwwN0aujIMCY15L0MTNEGGjr
	 /Rrja2TPVkCV0H+ZrIUhzJdM6kmABXmu5emR+5N/qI0OC3QnQixmoCYrRJMhb3dBNp7Cs
	 w7b2MbWdvpE4Ir1PptiFxSGhFidwIYHzhCRDEdqVwPrqCmQgVSUCOsHRMI2DCoiErdVh/
	 wy01VCNHnsFr6TdcBEXmMVZ0wpEx07/tgh/V4lyywHVZHax1Z0AoC2cRTqEtwqpqQXnNC
	 nYaZhhUKYKfufL1pftzyOsuaBRcqeh3iCa9SJysyqorEBE10O21qdZ9y0zrD+vtMRKA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796278391;
	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:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=gDJf1oW8egxByI9Fu3P2b64OpG52ymIdMqH8X5R850o=;
	b=bI4H71m8Crt1ImKIvSFxPT5Si+cf9FHPyLyLn5kJWGuW8h7jejwUv8YeBx18SWvctgEA
	 If6sfCHeUYSk/aHlHfVYf0YkeWxDZZjVPjJvKElnrO1adzNlQTA2JYARftvO9DKE1undA
	 JjAC7KORRZuqDiZaDB3vvtUoMfIvN4asJtA/T2uFb2sbqC4ke3qLTfjt0iaCmZL6QPmsr
	 JYY2TI/ufV8rG9qBgxI7au8SKfjHkCq1Ej541yxJ5IZcZFAB40Rma5qHAo8+mfWw+vcB3
	 l1MHUkhFjkdw8qZYB9G+qTH0PlHA2zbZxvxKJh3NVLJw2tkV04DGz0vB3PWAbX61YoA==
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="wCse+s/e";
	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 04F0B606A339;
	Thu,  3 Dec 2026 06:13:11 +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=wCse+s/e
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.171
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796278390;
	b=Uv0lMnpAksnOqB60UbCDGtSGrP/OZ8ZHOa2MRUWuh0JefWQEOIH8IyFBDnMFlQUt8MNj
	 UhKbJ/KGGpRDF3a0wWV5rhc/Qo7oBth4RYtu/CZ5lPwONyXhj38EaWP/3MiZ3480bVV2p
	 c2GdjEMjF0eVjCXsN+AbmUZG9Hf9t2jG6c0w15IgUJooBo10YhvmQJS0c7BhGqFFpdux8
	 BLJyVTfAH1RjGa0RlWPqRD+gUNF25MTbKsBHZkLpspaovOCxsgl7WaRdJiwwrAt7zPixf
	 Ze2SH0XCEXLl7HWoH56eNdEx5wFJCkhLeYBpFSc52WDgJHinvWDlNS5s8Ebmm/oO70g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796278390;
	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:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=gDJf1oW8egxByI9Fu3P2b64OpG52ymIdMqH8X5R850o=;
	b=0Cu2AeSRRu8TlP/Va7NYFMWDxpTua0kkHUv8fGqAsOAhCKOOWMkNq63XPPVWUx5cw5ly
	 JhAcJ0VFqkPPXKPQonT5XWD47h06QqCr00MoWQtqi3BksIX53c5UFALeh6XW8hqRlQbD9
	 5T1+aV1r3pZRZx9PCrYjzLOBo2uFSNB5Nx2u2egRZH21iL/2WwNEKXZNGqI1EdUnTWSmU
	 XG1Fmp39l1wLLH8UixupzG/Icx/GOkKzXMZc1O9YO+pmb05OMv1xWKqsdWSkEt3Ky6CbC
	 MO4LfEJNkoadcSld+xrwSHaBE55sDPNRBJ3j+DqLo3TMmq3CzwmC3EPbs5L+f9xrXsg==
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="wCse+s/e";
	arc=none smtp.remote-ip=74.125.82.171
X-Received: from mail-dy1-f171.google.com (mail-dy1-f171.google.com [74.125.82.171])
	(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 36277606A334
	for <netdev@vger.kernel.org>; Thu,  3 Dec 2026 06:13:09 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 36277606A334
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-dy1-f171.google.com with SMTP id 5a478bee46e88-38190551625so25732030eec.1
        for <netdev@vger.kernel.org>; Wed, 02 Dec 2026 22:13:09 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796278388; x=1796883188; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=gDJf1oW8egxByI9Fu3P2b64OpG52ymIdMqH8X5R850o=;
        b=wCse+s/emPDO0Ad90hXSw0gA0zujaxWf7W9M3aiS14lmSBHT/4TSiALnWgCEYLeoyD
         9t4SIMOblDZJC11qIDMYeWYFcDhg5hCw/nBCEJLkxxv5eFZGR9Sz4t0tdjPKf49XbHYx
         tNVzhsidwKsa8J7t8hGULY7ZdBgOMDuQvANKgmNvhJwAIuhh1ofHn2FpFj0+Deg1asA0
         sr2yTIGKRqdodhDLOPl1MrgGxnkcsWNL5JoTjwV2o+jlf5OBDXF2jFitLdfaX7qF+fUc
         jyIob1nRhrd6QC8mfnMXKMULJpAyGj7GIKeiP8+aiT18r/fDgSm/zD/8i1yG87D2d0y+
         d7iA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796278388; x=1796883188;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :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=gDJf1oW8egxByI9Fu3P2b64OpG52ymIdMqH8X5R850o=;
        b=JHaaZCIpNiExrI6Y9Ifip61lGo6K+gHNmOiZzztBGorHWoUwI58ADkJxGxgP4/NCZF
         M02jYIXLCYigRRprChWeU4cStMMPpJn+GRg8icc74Dj0eBQUcGqR1rNFFYLGcdyNvSWm
         R84gaavrNF4X3VyCfvaCoNgcpayZTEery10Um8ZCXqOuHnXTTEOLE4vKbuFcNqREUAfD
         XgnZNBQSOg2/JKMxZLn5W4LHqQMGGL1RGxEJho7O8VLq5T9zDGAaXN2Nib7v4f/uV1Xp
         BvI1PbMIlgiirqh4M1iofT5eXbU065S4CcpXZ4pajb1unnfvZ7qG4ioOumuJqbUxLjL+
         BanA==
X-Gm-Message-State: APuU4Z8E5R8+vDMUPJghmHmOApzWgpaa/TCti5bgdsWIJJw8gcXGAOYT
	3L7lBWFb4otEkeDkKXDX2YPcUV5KeutidyFddBs11QFVmv5QrmssgVQH+szH8itW
X-Gm-Gg: AZFdTZekaV04WtmzMa6IjvzP5DXr+fQYsHoH3GpEiigPCjuq1d6elFHt6us/xw7wck5
	jsuVx0gwhY+j0g9YClYgPoO+W6EH19yThaHA7jzWVFxpnLbaexnqkkFJYkGZ0ykDc01xlFuVIXg
	8oMKHlCVa81b3UhIYRZgAKs7rwU/oNl5+JmNVKWqY+45W0u/DBXo+7mY1NKoYvaPPVguwUqR30J
	JwQQHqIbfGttP+E0TphleVTa+7WKoT0mLpK2WX5znvyCO22EEj2mItBhJL6939lD26zAiyb5f12
	hxq/4ByANGL94OG5LTO5Wt2EL8UUXyT9s0zMpgaOgTek2u0UqsYaqRsQJTsiNo1dh4Au+D8HN2Z
	Nk6shbzGYfROPRzCrH708/XaMgviH0SrKl9XpSQ5qQaL7NV+GGg3JGYRpZ59e0iGjMp8ZEDPQwf
	hOdD64Hv9PQxNb1OOrdjcxBSzKGo+J/f9CL0CavFzeAly5fu3fJC+7awyeX4n44kEsdZwQaDoyg
	dF5ClZT3BPL4ftCQurPRE3tn2TDFYErrQAgBSzEBdlFvCLb7XWvqyIqindO/JHCQXNldS0tKmGm
	/QnTS2I4So+i3la0kDyZhG6Xqs/83VMO4hMQFc5qbkql
X-Received: by 2002:a05:7300:d508:b0:387:3f07:4869 with SMTP id 5a478bee46e88-3873f075a3dmr2803768eec.37.1796278388119;
        Wed, 02 Dec 2026 22:13:08 -0800 (PST)
X-Received: from localhost.localdomain ([2406:7400:51:44ac:c2b6:f9ff:fe77:10a0])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38730405b61sm12074437eec.24.2026.12.02.22.13.00
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 02 Dec 2026 22:13:07 -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,
	Amaan Cheval <amaan.cheval@gmail.com>,
	stable@vger.kernel.org
X-Mailer: git-send-email 2.49.0
X-In-Reply-To: <20261203061215.487858-1-amaan.cheval@gmail.com>
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