From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7174C1094462 for ; Sat, 21 Mar 2026 09:18:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 32C50612EC; Sat, 21 Mar 2026 09:18:06 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id sXmkZZsxnmTf; Sat, 21 Mar 2026 09:18:04 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 508E7612E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1774084684; bh=nBC8V2iTU1XkJSJcD9DqT6FEejB6eDAI0LxnistceK8=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GUOsp9iv2abAD3s4BqDiMgjl0MRrhQlNazN22V2B1e5az3LD8dfRffdWq/L3tCBv4 s+TLzcGnunyqPHPb8c3J6Ca1cF/DP0f22M44uA26x+0k4wPUhrP7GjutErSy+TgPW+ TYGrd8iNg4JBG2qYj8IkNunKVEaJGgMXq6m+VCOeLAibF6dnejmkV6pQPdK0Jg9xJL 18m82tRUSIORp4/yDFnBQWKhZLoqWUezk7puh3p9Jsu/PY2oc85cg2UsK+CTLWY9VH hxP2iIQYcI6G9bql6OoQvRc5IDqg8noW7xI4y/NnFpZsR8c0dZki1KuebzZxCNlZBp Ih3zSmSuhvvlQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 508E7612E9; Sat, 21 Mar 2026 09:18:04 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists1.osuosl.org (Postfix) with ESMTP id 86F7534C for ; Sat, 21 Mar 2026 09:18:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6C27A8258D for ; Sat, 21 Mar 2026 09:18:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AdT2VUUA_qCF for ; Sat, 21 Mar 2026 09:18:02 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 720DF82572 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 720DF82572 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by smtp1.osuosl.org (Postfix) with ESMTPS id 720DF82572 for ; Sat, 21 Mar 2026 09:18:02 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id BEE5860054; Sat, 21 Mar 2026 09:18:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81CFDC19421; Sat, 21 Mar 2026 09:17:56 +0000 (UTC) Date: Sat, 21 Mar 2026 09:17:53 +0000 From: Simon Horman To: "Tantilov, Emil S" Cc: daniel@iogearbox.net, ast@kernel.org, willemb@google.com, stable@vger.kernel.org, decot@google.com, bpf@vger.kernel.org, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, intel-wired-lan@lists.osuosl.org, edumazet@google.com, netdev@vger.kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, kuba@kernel.org, davem@davemloft.net, sdf@fomichev.me, aleksandr.loktionov@intel.com, aleksander.lobakin@intel.com, john.fastabend@gmail.com, hawk@kernel.org Message-ID: <20260321091753.GT74886@horms.kernel.org> References: <20260319224159.23885-1-emil.s.tantilov@intel.com> <20260320174843.137651-1-horms@kernel.org> <0275cffc-7a61-46fb-9d1e-c309ac680b80@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0275cffc-7a61-46fb-9d1e-c309ac680b80@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774084680; bh=oa4pCeGObUtEmfpti4pdZQ10bKk+YYr47M7vQbAVYYM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ck5quWWHUFYlP4Evri1ddtI3Hvyf3AKxDDkWR6oOf/vzlL40QEX/GODXybpTmPHN+ zcBgNvuS/Q1b28wywTWhz5gKRLcKnATDnYif0RlLD6HD9sc8rm3ypfQP5bQM3ZYZXQ 4Wphk8whbbg3E6vpPI8bQYCk5jVyRlIYCYIfMKZ4RUIeB8phnDfydVpe+G0xQ+UF13 iuC3mBBFCZTCqY81qOaQqPAhsswpIAXMJlUYzevmnLcmWzofwLmRfK2Pm2OaZEBCCt xGl+23YrSMocPQjJdoxpKPDxdO5trFINJU2Cj9T8mc1GLJWs4opNpReHEzTGJdOpj3 MJejaBfjs3cJA== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ck5quWWH Subject: Re: [Intel-wired-lan] [PATCH iwl-net v2] idpf: fix xdp crash in soft reset error path X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Fri, Mar 20, 2026 at 02:35:42PM -0700, Tantilov, Emil S wrote: > > > On 3/20/2026 10:48 AM, Simon Horman wrote: > > This is an AI-generated review of your patch. The human sending this > > email has considered the AI review valid, or at least plausible. > > > > For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html > > --- > > idpf: fix xdp crash in soft reset error path > > > > This commit fixes a NULL pointer dereference that occurs when > > idpf_vport_open() fails during soft reset. The fix restores > > vport->xdp_prog in the error path and updates the restart check in > > idpf_xsk_pool_setup() to use IDPF_VPORT_UP instead of netif_running(). > > > > > Fixes: 3d57b2c00f09 ("idpf: add XSk pool initialization") > > > > The Fixes: tag may not be targeting the correct commit. The primary bug > > being fixed is the NULL pointer dereference crash in idpf_xdp_setup_prog() > > that occurs when soft reset fails and vport->xdp_prog is not restored. > > This is not exactly true, this is just one of the instances that would > cause idpf_qp_switch() to be called. [1] > > > > > Looking at the git history, this missing restoration was introduced in > > commit 705457e7211f ("idpf: implement XDP_SETUP_PROG in ndo_bpf for > > splitq"), where idpf_xdp_setup_prog() was first implemented. While commit > > 3d57b2c00f09 introduced the secondary issue with the netif_running() > > check, the main crash fix addresses code from commit 705457e7211f. > > > > Should the Fixes: tag point to commit 705457e7211f instead? > > The reason I chose commit 3d57b2c00f09 is because it is the commit > introducing the function where the crash is occurring: > [ 3179.284770] RIP: 0010:idpf_find_rxq_vec+0x17/0x30 [idpf] > ... > [ 3179.291937] Call Trace: > [ 3179.292392] > [ 3179.292843] idpf_qp_switch+0x25/0x820 [idpf] > > The setting of the restart variable is where the above commits "meet", > in that both conditions - netif_ruinning() and idpf_xdp_enabled() [1] > can be wrong: > https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue.git/tree/drivers/net/ethernet/intel/idpf/xsk.c#n571 > > which would end up calling idpf_qp_switch() instead of taking the > alternate path: > restart = idpf_xdp_enabled(vport) && netif_running(vport->netdev); > if (!restart) > goto pool; > > Which was introduced by 3d57b2c00f09. Thanks for the clarification. I agree that using 3d57b2c00f09 makes sense. ...