Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E8EC38D3F8; Thu, 20 Aug 2026 17:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787248276; cv=none; b=oY7TKIPaPR5cfX8dsXacFdLRI5ZH2SQE0ohyZVB6Qm3oITIm5jyLgTb194T59w3zYhueT3Y70Wu0LsjpJCQ1OKts2G1Hhb/eTfHl6c8oFZxIki+MWAPHwaeWrJb694kjQN+P7DBbL4/3pKh0JeFDDCH6PkUDRFBkZENib4zz5gM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787248276; c=relaxed/simple; bh=uF9IxnnkXnMOsRwJ9qy7I9v6iVpyk7XKRSfrGmuEAWo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gl+VuDwAIGFpn3N3jXu/McGW/Nw2xR5eDLyBA6jt5a3Gu8w0FwpPld+FMBmCWjk4CH2LRSULPQfGF7bPmkL0aF6AQw2EUIUjw+DX4Dh4iodmXpywbAWOyasVMvda9RdZioJnBq266qLm537KVYZfx6aTz+Tky9F2Ow1zfmafs+g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=W8ewuS2F; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="W8ewuS2F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CE8C1F000E9; Thu, 20 Aug 2026 17:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787248275; bh=Fy3Cdq5bGoHDNbpXdqKgmVoEllHxp+y4+jF43miV2lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W8ewuS2FQ5QfcfdwApgaC6PET06C3ZUCP1sLM6b2JVVkwZsc8R1QAhJmi1pPwRvcR wuJVyp6ejIhTUJgq163r9xhTLSn1gQOByhl0ANIoy2zDrbGY57GVmpfbxHzRTu7M0x nNAFBD9cnx9Ki6SwRMQas+t2I0WZV8PnKj3pwQ/o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ratheesh Kannoth , Dawei Feng , Paolo Abeni , Sasha Levin Subject: [PATCH 6.1 171/303] octeontx2-pf: fix SQB pointer leak on init failure Date: Thu, 20 Aug 2026 16:55:07 +0200 Message-ID: <20260820145258.446840717@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145253.200766705@linuxfoundation.org> References: <20260820145253.200766705@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dawei Feng [ Upstream commit 62e7df6d042aeebd5efb581074e28865c04477be ] otx2_init_hw_resources() initializes SQ aura and pool resources before several later setup steps. On failure, err_free_sq_ptrs only frees SQB pages, leaving the per-SQ sqb_ptrs arrays behind. Use otx2_free_sq_res() for the SQ unwind path and let it free sqb_ptrs even when sq->sqe has not been allocated yet. The bug was first flagged by an experimental analysis tool we are developing for kernel memory-management bugs while analyzing v6.13-rc1. The tool is still under development and is not yet publicly available. Manual inspection confirms that the bug is still present in v7.1.1. An x86_64 allyesconfig build showed no new warnings. As we do not have an OcteonTX2 PF device and the corresponding AF mailbox setup to test with, no runtime testing was able to be performed. Fixes: caa2da34fd25 ("octeontx2-pf: Initialize and config queues") Cc: stable@vger.kernel.org Reviewed-by: Ratheesh Kannoth Signed-off-by: Dawei Feng Link: https://patch.msgid.link/20260630071625.349996-1-dawei.feng@seu.edu.cn Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1553,13 +1553,12 @@ static int otx2_init_hw_resources(struct return err; err_free_nix_queues: - otx2_free_sq_res(pf); otx2_free_cq_res(pf); otx2_ctx_disable(mbox, NIX_AQ_CTYPE_RQ, false); err_free_txsch: otx2_txschq_stop(pf); err_free_sq_ptrs: - otx2_sq_free_sqbs(pf); + otx2_free_sq_res(pf); err_free_rq_ptrs: otx2_free_aura_ptr(pf, AURA_NIX_RQ); otx2_ctx_disable(mbox, NPA_AQ_CTYPE_POOL, true);