Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.177 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796197264; b=HiatocSz+yrXvjgDYhkLj/cS4vNRL8e+f555XdU/prFax7vjMpXB3fMti++EJgwAG6kQ 96D6Ktft4JPkvi/ZNDtfXv9dFlRm9cQsUkiTlA1OgTicc+63OHj5PAyeDOmHnW044ch33 L+4DAwNngMtbXu80NUPFuQdKWUgYCFh6Nk7OT5RnJqA7mZds5xxI1hxXB9/ICExfMlGaW nSi1aEh9whMaZ4EA9tWt+aB5ZeYqdgAUHe+Tec8X84YW/DW9Xpg5C01XyZYhtBjkh3KiE IXB/CvnaS87FsA/KX1p5IMIUrhF8NSpRnikoFJs/1TJhiAEYc1lds7oRANzPvHdZjVA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796197264; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=ry66AGvM4eqdL7UuNUOygnpJrWk++WSo++zr6yQPjh0=; b=jpG58YnAFBqIwdSJpQrqs8G98gmVQmVkbVNdOdvfvy44qQG0Es1+iomJnIwVG7eW69z4 5duJBfMChn4wgEHa+3327cOdXg0rqde+OreaTwL1K2OATQCIeblGAUA+bT6gV3Bvt38rI 1n/+NwU2JoCDTHlOQj+keT4DkllmAbtVJD68bF91UhY4yonWKJZLd1ZUR351L3b+I6XJ1 U+drGDBnQATUjdaJ/iQa1ircop8FX4VY72EVxuzDXTkV0szukYxBQdlfo8/0VKuM6ARiH aMQLqi+voggdUCFftt1FEAyBeiS4sI4i0QPNtWw4oaJd1OqT5d6ybarRWCVzLDImJBw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=SrCyoQMw; arc=none smtp.remote-ip=209.85.214.177 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9C5C606A31A for ; Wed, 2 Dec 2026 07:41:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A9C5C606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=SrCyoQMw Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2f0426a65e0so71396695ad.3 for ; Tue, 01 Dec 2026 23:41:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796197263; x=1796802063; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ry66AGvM4eqdL7UuNUOygnpJrWk++WSo++zr6yQPjh0=; b=SrCyoQMwmvzx1Sd0VHIvTdmvA0vdt+dqBGW43S6AuxiZKLqJjT85e3/M4y6mpxxt+0 CAgg9ZebKtTC/LEUXmNqO/8lTU0j73H/d18vHc5fFNj2Dq9i2sz8Id0SjTDR1fDDXYw3 0VE8zm8pWFczK4nLA1cahjcy10efTkY3b8dRqb9v2wgQt61kiIyJlxSHT4p/Kfafcx2P wEk6A0DRVUM1efpHt/zEOVyfR4ORyOK5r1472zcUInuvMC6DtJB1xqnVMvauwnvb8QHU YGZXC/AzGp8ARAY4LgCi/7UXl7Iwvn5lDqHuJcfxFGX2OO1Wo5dQv/eTdaBK5l/VHKBl NZ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796197263; x=1796802063; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ry66AGvM4eqdL7UuNUOygnpJrWk++WSo++zr6yQPjh0=; b=nLPt60vNl0shVR06dggxA404GixGyroEp4FeBaydUO/fOGfrDioDM/eVKHMQJLaJxQ oQDgoJFsO13oA/HOr452lbM8qyDQ4YlQ7CzVK923R8zHcVUHQ2n95EI/2K85KmPOALv9 r0JXe8BQlgq0svpfghIBclUdZx8QpIDb6CxnJE60kZu28jBVpSkiWtfio3LAU9GpVNwa meJon8P68H0qjNGCfsPG8sVihaUEq9kY7912C2JdxjmFPmTLhksJDRIw3AoK9/HPvfma W4OZWBwoywK/FToa8hTYgYI+JE4+LnMiGgKdKfLOXo1Pl/dqiDErN50MrP6FIIQUOksd lagQ== X-Forwarded-Encrypted: i=1; AL+hErEGNeo8F6fmLOIIuKWg1AfidMS+DfJdWZn8K7CUTGet3eXZlly4xTyC2iqyNZ8Qf7Bgrb2zqY+2NNc0LXLuZA==@lists.linux.dev X-Gm-Message-State: APuU4Z/2Bu4ewcIqL1vzqtIHHpgfqUiylfQd6poA5nvNcx/IsUBrwGfA t5wfygZgCFdcaH8yecXm0YPfOimHYiwNKy8fNaxOC+Mpf4dRiOkWvdmR X-Gm-Gg: AZFdTZeZE5txK5wWTcWGbk1AjEJXTb0waMn5ao27wc9Bi/cAVaK+HHpz1Osq8FMdlnI vSkeqVB1W7fi9l8NNRsRw1wAZDsxpDII45rJJucBMDvs309D0qeRxKbfca5HLFIwbAV3M7xvmaF QiNCSa8cyIAO54o4kEjp/CTmyMbpG5rYqHHd38nXZaHit5u0/qh6aMu4mX8KAUuxit/llyBmbFx 4c83+AVWZs+d731XDHZDO+XqCydWCyvokMxy5JYvt6DUK4rpYdg4oynHPzVEJxMykp1jSqa23o4 iRgQpRf+5pB22AOQ0QhFnOLxxjDzBRolZ+xz6BitpmMuwsRqrQNHmo8I5SzK+vub4wWYRlIQQHz XnF8s23AAHIFaWZ46AIXULVLKPbykiykPhf6S3WoK9t6BhOebOz9DS1n5ZzJ3UuhUEjkrW6YDAN 0M49Ohf4AVo6jScqeDYXwNaufbRs8josp/9dWQcVGOewlO+ipVYFFeSGEUfbsdY76jDRrfsyoN0 UVjQhwKlymvupI7zZLUkZpSJKQjYJ4rGcdS/dZx6NfugHAGgM5c9p487FSaYkhF2mhcRNP9fD0w gmhfShtwa+iG57agYiNIEYuA1GYwLE+FFoRLHCI6gUckuoo3rgXZUIqnLxLaukKV5W+eBJeQ4A= = X-Received: by 2002:a17:903:2f90:b0:2df:ad58:cf54 with SMTP id d9443c01a7336-2f03f2158a7mr359481995ad.34.1796197262751; Tue, 01 Dec 2026 23:41:02 -0800 (PST) Received: from lenovo.localdomain (211-23-53-87.hinet-ip.hinet.net. [211.23.53.87]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03f0c42a6sm198620915ad.23.2026.12.01.23.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 23:41:02 -0800 (PST) From: Yu-Hsiang Tseng To: linux-wireless@vger.kernel.org Cc: Jeff Johnson , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Yu-Hsiang Tseng , Rameshkumar Sundaram , Baochen Qiang , ath12k@lists.infradead.org, linux-rt-devel@lists.linux.dev Subject: [PATCH ath-next] wifi: ath12k: hold RCU read lock when dumping vdev and beacon fw stats Date: Wed, 2 Dec 2026 15:40:58 +0800 Message-ID: <20261202074058.87337-1-asas1asas200@gmail.com> X-Mailer: git-send-email 2.56.0 X-Mailing-List: linux-rt-devel@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 Commit 4498664e2d58 ("wifi: ath12k: use lockdep_assert_in_rcu_read_lock() for RCU assertions") changed the assertion in ath12k_mac_get_arvif() from WARN_ON(!rcu_read_lock_any_held()) to lockdep_assert_in_rcu_read_lock(). The old check was also satisfied by any non-preemptible context, the new one only by rcu_read_lock(). ath12k_wmi_fw_vdev_stats_dump() and ath12k_wmi_fw_bcn_stats_dump() call ath12k_mac_get_arvif() from the debugfs fw_stats open handlers with the wiphy lock and ar->data_lock (spin_lock_bh()) held, but without rcu_read_lock(). On a !PREEMPT_RT kernel with CONFIG_PROVE_RCU=y, opening fw_stats/vdev_stats or fw_stats/beacon_stats is therefore expected to trigger the WARN_ON_ONCE() in ath12k_mac_get_arvif(). PREEMPT_RT is not affected, because spin_lock_bh() takes rcu_read_lock() there. The warning is a false positive: link vifs are only torn down under the wiphy lock, which both paths hold. Take the RCU read lock in the two helpers anyway, as ath12k_mac_get_arvif() documents and as all its other callers do. The two callers were found by code inspection, following up on an automated review of the above commit [1]. An AI coding assistant was used for the analysis and to draft this patch and changelog. Compile tested only. Fixes: 4498664e2d58 ("wifi: ath12k: use lockdep_assert_in_rcu_read_lock() for RCU assertions") Link: https://sashiko.dev/#/patchset/20260422180814.1938317-1-asas1asas200%40gmail.com [1] Signed-off-by: Yu-Hsiang Tseng --- I don't have access to the WCN7850 machine at the moment, so the splat itself is not reproduced; the analysis is from reading the code. I'd appreciate it if someone with hardware and a PROVE_RCU kernel could confirm. The review in [1] also claims a use-after-free in the fw stats RX path on PREEMPT_RT. I don't think that one is real: ath12k_wmi_tlv_fw_stats_data_parse() takes rcu_read_lock() around its use of the arvif. Build tested on x86_64 with CONFIG_PROVE_LOCKING=y and CONFIG_ATH12K_DEBUGFS=y, W=1, no new warnings. drivers/net/wireless/ath/ath12k/wmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index f41138a7c6..942a3a6cf0 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -8038,6 +8038,8 @@ ath12k_wmi_fw_vdev_stats_dump(struct ath12k *ar, u8 *vif_macaddr; int i; + guard(rcu)(); + len += scnprintf(buf + len, buf_len - len, "\n"); len += scnprintf(buf + len, buf_len - len, "%30s\n", "ath12k VDEV stats"); @@ -8116,6 +8118,8 @@ ath12k_wmi_fw_bcn_stats_dump(struct ath12k *ar, u32 len = *length; size_t num_bcn; + guard(rcu)(); + num_bcn = list_count_nodes(&fw_stats->bcn); len += scnprintf(buf + len, buf_len - len, "\n"); base-commit: 92adc530e9b0c1f680a3b78326e069b55ccf2029 -- 2.56.0