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=1796382420; b=c3Tr733UOXI6CsBlnnFheANzCaC5HuYyj+BX1jBP/QD26T3h2VOiO7f1jGGUPpT02Rgs OWn7D8cEUZv9SD7xoxnM2hZp10lR3Ti+oAYEhlwV9Xy6nZ1MUaYB8cSSzH0m+pj1P6QR3 ShcfpfUkTKgvILKmpBTWC7Ix13SqlzXohfTX4ImyQxd1wkfKRB1igSBc41Y4j8BEd+aqm tcAQM7GevlGkJxlkwMmXgBnQpu7OqCFgYmVc0Aa4YKJjqDlU6uDiOxxXVWjqytPyCrTOG 9w9pf5gKosTUOwnwHX/7edqrJ77XtT2mhHdk98zmDkrhvEcCjN61B7FUoTf+26L/8rA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382420; 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=2OZc+sDgjYXKarBEq5kNaOTYXQL9Jh6mL0z7mplCoFQ=; b=Blmi566NBeS3QdJMwUqLA5MSnotYv+vR7zDloIOarbR+rYn7C7DrGoZ3+TnSxWTY4GCL XIWexvDRPPFbfcrrvFrJKpxbG0xWzHMQGtQiHO2ni3gTyIpMjqexxrbLz8YpF8B7f7Ffl 7+uPI+PXqKzgjTyN/O9MdB88QCZ5k2OXeNEiHDsRayP8eGBxqaUoBMe9HOCb6TwMpe2fy eqYRen3KiZ1aGrON/qAQvwitGmPvvz6RakHRBO4kgZkJxkNajV1/O7fAwYCbe5aldWJxi 6szcy/ZJmHFHS+zP4Xl0/eUuSNFyBpsP6HiSOcI5ltt7g/lO7MG7c4ozd1dK+K3K/Rg== 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=mXkqaHEm; 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 F4148606A338; Fri, 4 Dec 2026 11:06:59 +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=mXkqaHEm Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7227C1F0092C; Fri, 4 Dec 2026 11:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382419; bh=2OZc+sDgjYXKarBEq5kNaOTYXQL9Jh6mL0z7mplCoFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mXkqaHEmOBqhlimIjOWvddCNo0ta0GxYgJq2BtEiu2xWuYQZPAGF6rKSEaEtYdEko mXav8FY3cicaEzGL6crtIo4OGFVl4LgIVTmOBSsHcGPrA9yVKh4AGdHNPeYkDrtpX0 XPBZuI36EPDTdCj2DVWVYyn+WRIGF4kl3Iyi848w= 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.18 444/703] iavf: fix ASQ command buffer leak on init failure Date: Fri, 4 Dec 2026 19:05:43 +0900 Message-ID: <20261204100639.614492654@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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); }