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=1796384814; b=umU1ve6/iseUd32VYFUwsUxSXyhiE4opVW13Cv5H/HQEstWpdfkjqG5gFtHQIc6pZLtW GcMpW2J4wY4Q0p89ogOqn4TdtkrVVFsOYma+2qXhGYNwhK5JZFWAhKK33sEpGU2F0jWBR 9NRmnzrtRWaD45ESIxalKV/SyUk5L7bHLpIbKv0N9Qq4O1fvhZdJQsnt1vFVicC6iQQdn 9h8reRxYQlSewsmsOIVRtbdzNSBPFAkucPfPM/Sa+Ag4xo+XoQhnIIic4OXtHR4RvKHUT a1nhfHcgSuekrg6VFir4Ma30CAgcvF2moZVrLoGiK5WJgKfK212L/mayWW8paCLgJQw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384814; 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=LgAYe/WQdLR7hvmV9QIcXp+JF1Ly5H4SSwkDM5bymQg=; b=qJnqqCix0zFi20x5VMWQUeAb3tk5opFsG9Fuh3KJU3Ea73PkkaJZ3eIK4CM8HHHQCRMs xxWoY9AWCh/BGSjPJjnOX+u5Q4AFMDn4ngSj770L8zLeatKTjx6dWtSFkoHpJ81rnL7+O UmdWE1jBjq5EfX0jDzyLiL3a5vrpCYjNKMXR8Hd4IygVDHS0eZTNmka9Ba3nYvNDOPJQI LOZN9U+cid7mV2gaXGiJo/r+V1MSDZyGRbECJFRRmTEwAuDV+iXCyIRPA+FJrib3Ok8su 3nx6PYcSk2+Tq/vTHDjrgClZYoqXtT2XX6XXOlLzVW/usF7x70xEKyLEMIABwgl2ZdQ== 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=g7IM9kxn; 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 9D9D9606A32C; Fri, 4 Dec 2026 11:46:54 +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=g7IM9kxn Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17D921F00897; Fri, 4 Dec 2026 11:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384814; bh=LgAYe/WQdLR7hvmV9QIcXp+JF1Ly5H4SSwkDM5bymQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=g7IM9kxnIhgZg5Pl7oKWGCO9xlMv2QRX0civk62lc2r7C4b9RdYQZDjSCHyOPXrZb KYpKuk/uDKBAJV8+HV96rK3MxqbwNcqGbA5hAIuPqkL2tJkn+MKw6g0oJrU0dxFkWo BPt9p4yz5H+9gv5SKtUOVU9N0nm2ydhqDOMz10zE= 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.6 0305/1167] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Date: Fri, 4 Dec 2026 18:55:32 +0900 Message-ID: <20261204100709.968207990@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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 context for the older tree: ath11k_ahb_remove() returns int and ath11k_ahb_power_down() takes one argument, with no logic changes. ] 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 ef11c138bf307..892805b520f40 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -1261,14 +1261,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