Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.179 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796278358; b=GjyMCDGz9GN0aQBknlo7bKFSYtb/ewlioVLE0vkt2zRGs9x3RhxqFFtHhB2xD8UHOtFO FJXXnRNo3XgRieKJg+gDlkYA7HpA+QMii3deuxQqbbxwRFVqq/M127MQFI+RW0elmU9zW wcSdmWUkaef+RJtQivCCJvGmzykILX3DfE2UFpXJz7Qns3ibBfkj+yRNxOvz3csBpdmZF 3OnZIk6rnilsgujRNlv7lB+dFp71byw5n1a3kfDZRKX3AN6yS+vT2/vsOaF7zj66NTVWm wbhDRJgKaUqWFbSubWxcujxluYktDyc73H+RSGNzRP7fKmq6nv+OhKxlL1C8qPpYkOw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796278358; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted: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=7hCRqzf3fGP8cLiCJZ7kRLaYVxFYpfchl8JfZIQBsXE=; b=18VvLhB+h69iOTKW8eqU4+N1KMWtUuDH94TktlaL5M9Yj+xoQRiRbdD0vmr/nCjCfoJi XDat/v8KJ6oSLDO4LS3awo7Z2AWotzKVB6x6Gg0cc+xhTXkS18b8NPuJLKY4n8p2aMHHe V3DebwlhHqd3sBAr/V1i3KsAe9b6HqoOHIRGUgx/1CyHF3pGcciHLjGxM9exVLV9fZ1n+ F9T3Dw6ksgncBDT6zRHVK/Jpw1WNUBcyfI5Rc1yMWJYUDuYkmqiG55CzIG1rk+yGWcwE3 cs37JT15PIX9KXdTEwgWBO8xq8QQimN1hL75LaFhTPHGm2F1rKL0Hh2/UkryHifKpXw== 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=aBV6R7CR; arc=none smtp.remote-ip=74.125.82.179 Received: from mail-dy1-f179.google.com (mail-dy1-f179.google.com [74.125.82.179]) (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 06693606A330 for ; Thu, 3 Dec 2026 06:12:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 06693606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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=aBV6R7CR Received: by mail-dy1-f179.google.com with SMTP id 5a478bee46e88-38747f42472so64780eec.0 for ; Wed, 02 Dec 2026 22:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796278357; x=1796883157; 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=7hCRqzf3fGP8cLiCJZ7kRLaYVxFYpfchl8JfZIQBsXE=; b=aBV6R7CRqdV0mQ5nxPv5/VT0Tds5LgiCUrZa5Taimf1pQGEnvzo9ZPVPAIH0TO7bQG jy45WHl6NnCU9hqIIk7/3WJkSA16AyaK49Ws6cZVHdLsarkwFzzKzxgYkli17IvLIqRS 7sfJGp6DDm0yqJybDkB7pGs5f9oKpy0LCnsveKxI3jkLPChApda9QyHe//zdiwHrYV9F oahYukkUFLT/7MuR3UDOLXdyYHeDe98pEctKvQV2RJkN8HyQXk8OpWRNfTkworrn1but oSwAQaUtpxH+/GGTSJIRVY2mYQGGOuRUyfuPmX1PeWh8vLjsuOh4dacixP9zNzN/R5UC TfPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796278357; x=1796883157; 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=7hCRqzf3fGP8cLiCJZ7kRLaYVxFYpfchl8JfZIQBsXE=; b=OdBBxbpartp7V81gFS4wdXfLANVkru7Fd4Fo5e34g+to0a4JOqZr657WDDn1wksf3t v+FYbbNfEnWmgnrjrkhJ1DMfXeIbmvUd0uu6gbTrlqlIEHVU8HjVTrUHzqsVwJgz6Rua 8X1bX4COLG4lTRzXl4aPxIBIO1gP555iDJHHzjmwfcJjCXtQTMQlWspWj67v+iZuZLLC DNgGk+cwxXkVDLNFsMTVQK/ot6zy030GA6gnCScvKU5TNVzKxs1aOkSRbgHMrrHfxeCE Ay+VlKOo84cAAPMkAOpyWNRdSQoHNmcNbcat7FoUc/rwtyIrOkTFWrbwiJ3dK1SfncCJ aw1Q== X-Forwarded-Encrypted: i=1; AL+hErEpD7Mx0V5dOM6v+mTFhxDi/ugtyrBXwjmcYCWIbAy4l4WCl0GpYU1/ScoSIOGs6b7/Hzw=@vger.kernel.org X-Gm-Message-State: APuU4Z/6l2PaWDN28Cv7Fe659McTf3a67MNedAgKgBwrg+N6T/FFoQx/ gXXBX9uoJihNCia6SasiDUByIMUXf4glCswH/fpxbxwxsltU/CL+Q834 X-Gm-Gg: AZFdTZfec6kZ0cQImXTFbiSNkmm5U3CxA+sKPLP5XfZh4ZV0/4T8jqoMzWmFoR9iDgS D0VCRwzS3QT25aJJkQndaTeJJ2GWgdjzCM3Rdh4gRkUegCg5BKuq4h3wcIRoLe1RuS4F7TMXo4n dEbh0wTSnBECSVvsW5aZSAVZlFpal5frLMoXJ7dQxeC3yf10mXaWySyMoxQ4xQNdmdbED234t5t 5ouXnlbba4kH9bAY2RRezd6WvjKFDlrlwS89fksUXQfb1qYe8alaVBKfpEJUOwJwJw0oHJf7VY7 bqI2Wt4zWgAcTAKt+ZtoAq3FY53RCM/YgLARRfaPE/ZekTCe/gQcxAL43eEGFrK/vjONGQJWbLJ uWmNk4rgJrkV7mUAsafuwnWqs+YDT2Xs3mO+liHyDKoJ0clb3ioGW6U3J6y6MPNmdKaq5kpp7r7 Gt9x8kHHqaPZj9oMbMKraAQ5fwtkryNzsYU4qM7e9aohS43bwbxMpxkB62exsxt/KVOlubifxT2 /IEHc5sSMplQaZhjyJQAbwGUdaOxHl7sxSGgIib/mQLlSgRCImAi0XPDRkRNgVv0gd2JOFxzOc8 AwIC/pWvMBpoTFPjRz18A/hZeqTzF0CYyZBlirjcxG3H X-Received: by 2002:a05:693c:42d1:b0:386:b0ea:327d with SMTP id 5a478bee46e88-386b0ea3549mr29595388eec.5.1796278356952; Wed, 02 Dec 2026 22:12:36 -0800 (PST) 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.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 22:12:36 -0800 (PST) From: Amaan Cheval To: netdev@vger.kernel.org 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 Subject: [PATCH net 0/2] gve: fix XDP program and XSK pool removal after a config change Date: Thu, 3 Dec 2026 11:42:13 +0530 Message-ID: <20261203061215.487858-1-amaan.cheval@gmail.com> X-Mailer: git-send-email 2.49.0 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. 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