From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383838; b=1lPt7OT62j3uZJuugK2c170S1cmeWQekf76iS/6GxzEg6UA1UXOEd/3/N5ryUI+GjDQd obGZriXkYJdSxIZQpd3r8okW3whvDcZPm45w7CigOJAftM/dFPA4oQj5tOA45g9i/8Ck4 q1Y97phSxvHhlf1+e1FlkzqfZF7Wi73VsFi9Kd3k3E0Xk+6VK6bTEjLOhi4UUTovxHCFy GcvAJ/6Y0M0Gm1Umj4F4YWsAmAckSMpEZa+lQqSM6roD0Z3kc7Y+lE3FlNmzhjBZ4rfoI ra5avivOQ3LxMlA7qfKzSjGB7i2T5PVpdVXEY+BjkyJFt9vR1UKE+TyE2dRgA3IvVhA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383838; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=y+h7pIPWB8oRFSFb3+uduCeW0aBTXceMkFk3gZWkQuM=; b=hX9cvXkX3qirnpk5kRmWxCkudWWSNovmbi3VhaGUfndXVG85gZUUbxuV78YjSFHBt1Zg CY+FJ+x+5N78RaaqZgbMVokUCqGPWmkVmmlTL6BOB9MR3fPuU8uNJ6YyKJjx4FuU1YtwO TlZFPo5RvnIE4I4/v901VntrWNcEKk8QWoOWNAwG/W6vt/JmFrutfiTNCJNDKDG/mTiDJ MbcswAyeNIajavfxpOyskIddsr361cumZSKlTuodfdtwVonx8MQj89JjucXOj6px5BIKw 3EdmOcMRxZxjQsfjOXFr49hC8+9tgrLQCmBBv/fSSjPrM5CBatbTywAszkgoqhSs9Cw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MLlbWHpk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76543606A322; Fri, 4 Dec 2026 11:30:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MLlbWHpk Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1FEA1F000CE; Fri, 4 Dec 2026 11:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383838; bh=y+h7pIPWB8oRFSFb3+uduCeW0aBTXceMkFk3gZWkQuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MLlbWHpkQhTF0+X2IMzW5d+4XLAsoO14W08r5BBIX5yclyHFXqs/LKk9aVC3G7Ecm 3Z9l56qxzeILWTxX3CX3c1aAipnX/58UJx+LfrzvkcEJCL3s2HNab9/ESSkrdFOlHl ixj+iI6x7XahcQj1FNe+AqCexlSRDCQfi6+hN8eY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xuanqiang Luo , Jedrzej Jagielski , Aleksandr Loktionov , Tony Nguyen , Jakub Kicinski Subject: [PATCH 6.12 389/555] iavf: fix ASQ command buffer leak on init failure Date: Fri, 4 Dec 2026 19:07:12 +0900 Message-ID: <20261204100624.546010854@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xuanqiang Luo commit 2a1f106379a90ce7ac63f96a57c241a4cf20a983 upstream. iavf_alloc_adminq_asq_ring() allocates cmd_buf before the remaining ASQ resources. If iavf_alloc_asq_bufs() or iavf_config_asq_regs() fails, the unwind path elides cmd_buf while freeing the other allocations. The ASQ count is not set until initialization succeeds, so the shutdown path cannot reclaim the buffer. Free cmd_buf in the common unwind path. Fixes: d358aa9a7a2d ("i40evf: init code and hardware support") Cc: stable@vger.kernel.org Signed-off-by: Xuanqiang Luo Reviewed-by: Jedrzej Jagielski Reviewed-by: Aleksandr Loktionov Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113004602.129864-6-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/iavf/iavf_adminq.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/intel/iavf/iavf_adminq.c +++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.c @@ -60,6 +60,7 @@ static enum iavf_status iavf_alloc_admin **/ static void iavf_free_adminq_asq(struct iavf_hw *hw) { + iavf_free_virt_mem(hw, &hw->aq.asq.cmd_buf); iavf_free_dma_mem(hw, &hw->aq.asq.desc_buf); }