From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.45 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== 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== 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 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 ; Fri, 4 Dec 2026 06:29:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 68B94606A322 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=x5NSPuzf Received: by mail-dl1-f45.google.com with SMTP id a92af1059eb24-1b5d5f12565so450485c88.1 for ; Thu, 03 Dec 2026 22:29:19 -0800 (PST) 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) 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) 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, 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 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 Message-ID: <20261204062857.730993-1-amaan.cheval@gmail.com> X-Mailer: git-send-email 2.49.0 X-Mailing-List: netdev@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 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