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=1796387463; b=Z13KvMPIvQIIQxZCiTrz2Eqj8luXzzgoTPj1BtYbgwFc+LvgrsVYYES5VFOa3PGcNn6M LA+YVG88j/QkqYzl9FXna3hCUVABqTz+Gtf3YTkvv36cBfQw0fH2HiqL/YNi4IOxOVwTb u+EbkBGNQsxNl8E/KrCPHmuTMgRSIX0Ni87hfVYgDlqYu+102k1pOhU0TRoTULEJZ++Cj ymND3w/EKnsAqcJhVUlLgzggbJiKDcFvtPC0tZLc2nwct/zXqmCDAXyylxlYcnx7TLJY8 UaGR9mCVtaMMBM61o/ZbGO0zbn1GsnxmkKwF1uYc8VIImZWkjwDfFzpDXNlDt/URgXw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387463; 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=kaL3xfxNYqFq2HDA12BBIbB7VQWexHtHW50+9yyA9gA=; b=TVcI5xK/6KiNijCl1zahMg7yFE4y647BLAD22PP9I2C/2bPHsuYdj190PuQ+uTJOUKgM AoFLlwwtaeRPOda0EMigbTESR+x7m2iK7QfG5rzKU5uGWNvduDiK2D6CZ8CV+koHr1hqL q085qbDu5gEMXmRNW3Lbqc2hwDjdsmHSrRE0DbrIO2RQCASJYkPGYC2ZqlSIkHi4nNDyh Y/7B7zBj67UF3ss3aJyLIAzJbVyWfvI4324PCgHsQf2mXFSvqzm2RxOA7hmL960tBhKmm tnYAcvi8T4POyo76zVmCuIq0HILDnxv8rpGwrLJ/MwUmHCjcnN4jttGdE8pcrrnPY8Q== 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=MJDO5LPv; 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 63B52606A322; Fri, 4 Dec 2026 12:31:03 +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=MJDO5LPv Received: by smtp.kernel.org (Postfix) with ESMTPSA id D16D21F000C2; Fri, 4 Dec 2026 12:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387463; bh=kaL3xfxNYqFq2HDA12BBIbB7VQWexHtHW50+9yyA9gA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MJDO5LPv33Jpp3AfiniPWq8VY3MfIqWV6O4AtIJiiPS/oSrlQgavLWGBmRxHKrWy4 vR8x2KnBhSrtzoSeSupKPmsTxOw//0vGbLhPL0bTZM/UFBaLybdedq6ueTN99jBNUT 9LpGae0jR5WNVIFmlwV0xAa2nyD++w2audFNm6O4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Miaoqing Pan , Baochen Qiang , Rameshkumar Sundaram , Jeff Johnson , Sasha Levin Subject: [PATCH 6.1 0254/1059] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Date: Fri, 4 Dec 2026 18:56:25 +0900 Message-ID: <20261204100650.850911194@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@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 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miaoqing Pan [ Upstream commit 1a7bcf5324c8e2de6512eca5b028b6b283181d3f ] On WCN6750, if QMI messages never arrive (for example when qrtr_smd is not ready), WLAN initialization stops before the device is fully registered. In this case ATH11K_FLAG_QMI_FAIL is not set because no QMI event handler is executed. When the driver is removed, ath11k_ahb_remove() still calls ath11k_core_deinit(), which eventually triggers ath11k_ce_cleanup_pipes() on uninitialized CE pipes and results in a NULL pointer dereference in ath11k_hal_srng_access_begin(): ath11k_hal_srng_access_begin+0x14/0x68 [ath11k] ath11k_ce_cleanup_pipes+0x184/0x190 [ath11k] ath11k_pcic_stop+0x24/0x38 [ath11k] ath11k_core_deinit+0xfc/0x1c0 [ath11k] ath11k_ahb_remove+0x38/0xa0 [ath11k_ahb] Fix this by invoking ath11k_ahb_remove_prepare() before the state check and skipping ath11k_core_deinit() if ATH11K_FLAG_REGISTERED is not set, core initialization did not complete and CE pipes may remain uninitialized, making ath11k_core_deinit() unsafe. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00204-QCAMSLSWPLZ-1 Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device") Signed-off-by: Miaoqing Pan Reviewed-by: Baochen Qiang Reviewed-by: Rameshkumar Sundaram Link: https://patch.msgid.link/20260806101331.484063-3-miaoqing.pan@oss.qualcomm.com Signed-off-by: Jeff Johnson [ sashal: adjusted the ath11k_ahb_remove() hunk to keep the local one-argument ath11k_ahb_power_down(ab) call instead of upstream's (ab, false) ] Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/ahb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index db20b39c0bf56..795700433eb06 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -1282,14 +1282,15 @@ static int ath11k_ahb_remove(struct platform_device *pdev) { struct ath11k_base *ab = platform_get_drvdata(pdev); - if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { + ath11k_ahb_remove_prepare(ab); + + if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) { ath11k_ahb_power_down(ab); ath11k_debugfs_soc_destroy(ab); ath11k_qmi_deinit_service(ab); goto qmi_fail; } - ath11k_ahb_remove_prepare(ab); ath11k_core_deinit(ab); qmi_fail: -- 2.53.0