mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH ath-next] wifi: ath10k: filter non-UTF testmode events
@ 2026-07-30  2:32 Linghui Wu
  2026-07-31  1:41 ` Baochen Qiang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Linghui Wu @ 2026-07-30  2:32 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, jjohnson, linux-kernel, Linghui Wu

When UTF monitor is enabled, ath10k forwards WMI events to nl80211
testmode. Non-UTF events can therefore be delivered to userspace and
confuse FTM tools which expect only UTF responses.

Only forward known UTF event IDs from WMI event namespaces that route
events through ath10k_tm_event_wmi(), and drop other WMI events while UTF
monitor is active. READY events are still handled by the normal WMI
receive path.

Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.3.7.c5-00093.2-QCAHLSWMTPL-1

Signed-off-by: Linghui Wu <linghui.wu@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/testmode.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/testmode.c b/drivers/net/wireless/ath/ath10k/testmode.c
index d3bd38569..282ae6e20 100644
--- a/drivers/net/wireless/ath/ath10k/testmode.c
+++ b/drivers/net/wireless/ath/ath10k/testmode.c
@@ -156,6 +156,14 @@ static void ath10k_tm_event_segmented(struct ath10k *ar, u32 cmd_id, struct sk_b
 	cfg80211_testmode_event(nl_skb, GFP_ATOMIC);
 }
 
+static bool ath10k_tm_is_utf_event(u32 cmd_id)
+{
+	return cmd_id == WMI_10X_PDEV_UTF_EVENTID ||
+	       cmd_id == WMI_10_2_PDEV_UTF_EVENTID ||
+	       cmd_id == WMI_10_4_PDEV_UTF_EVENTID ||
+	       cmd_id == WMI_TLV_PDEV_UTF_EVENTID;
+}
+
 /* Returns true if callee consumes the skb and the skb should be discarded.
  * Returns false if skb is not used. Does not sleep.
  */
@@ -182,6 +190,12 @@ bool ath10k_tm_event_wmi(struct ath10k *ar, u32 cmd_id, struct sk_buff *skb)
 	 */
 	consumed = true;
 
+	if (!ath10k_tm_is_utf_event(cmd_id)) {
+		ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
+			   "testmode drop non-utf event cmd_id %u\n", cmd_id);
+		goto out;
+	}
+
 	if (ar->testmode.expected_seq != ATH10K_FTM_SEG_NONE)
 		ath10k_tm_event_segmented(ar, cmd_id, skb);
 	else

base-commit: 913998f903fb1432c0046c33003db38a9e8bedb1
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH ath-next] wifi: ath10k: filter non-UTF testmode events
  2026-07-30  2:32 [PATCH ath-next] wifi: ath10k: filter non-UTF testmode events Linghui Wu
@ 2026-07-31  1:41 ` Baochen Qiang
  2026-07-31  5:54 ` Rameshkumar Sundaram
  2026-08-01 15:55 ` Jeff Johnson
  2 siblings, 0 replies; 4+ messages in thread
From: Baochen Qiang @ 2026-07-31  1:41 UTC (permalink / raw)
  To: Linghui Wu, ath10k; +Cc: linux-wireless, jjohnson, linux-kernel



On 7/30/2026 10:32 AM, Linghui Wu wrote:
> When UTF monitor is enabled, ath10k forwards WMI events to nl80211
> testmode. Non-UTF events can therefore be delivered to userspace and
> confuse FTM tools which expect only UTF responses.
> 
> Only forward known UTF event IDs from WMI event namespaces that route
> events through ath10k_tm_event_wmi(), and drop other WMI events while UTF
> monitor is active. READY events are still handled by the normal WMI
> receive path.
> 
> Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.3.7.c5-00093.2-QCAHLSWMTPL-1
> 
> Signed-off-by: Linghui Wu <linghui.wu@oss.qualcomm.com>

Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH ath-next] wifi: ath10k: filter non-UTF testmode events
  2026-07-30  2:32 [PATCH ath-next] wifi: ath10k: filter non-UTF testmode events Linghui Wu
  2026-07-31  1:41 ` Baochen Qiang
@ 2026-07-31  5:54 ` Rameshkumar Sundaram
  2026-08-01 15:55 ` Jeff Johnson
  2 siblings, 0 replies; 4+ messages in thread
From: Rameshkumar Sundaram @ 2026-07-31  5:54 UTC (permalink / raw)
  To: Linghui Wu, ath10k; +Cc: linux-wireless, jjohnson, linux-kernel

On 7/30/2026 8:02 AM, Linghui Wu wrote:
> When UTF monitor is enabled, ath10k forwards WMI events to nl80211
> testmode. Non-UTF events can therefore be delivered to userspace and
> confuse FTM tools which expect only UTF responses.
> 
> Only forward known UTF event IDs from WMI event namespaces that route
> events through ath10k_tm_event_wmi(), and drop other WMI events while UTF
> monitor is active. READY events are still handled by the normal WMI
> receive path.
> 
> Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.3.7.c5-00093.2-QCAHLSWMTPL-1
> 
> Signed-off-by: Linghui Wu <linghui.wu@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH ath-next] wifi: ath10k: filter non-UTF testmode events
  2026-07-30  2:32 [PATCH ath-next] wifi: ath10k: filter non-UTF testmode events Linghui Wu
  2026-07-31  1:41 ` Baochen Qiang
  2026-07-31  5:54 ` Rameshkumar Sundaram
@ 2026-08-01 15:55 ` Jeff Johnson
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2026-08-01 15:55 UTC (permalink / raw)
  To: ath10k, Linghui Wu; +Cc: linux-wireless, jjohnson, linux-kernel


On Thu, 30 Jul 2026 08:02:26 +0530, Linghui Wu wrote:
> When UTF monitor is enabled, ath10k forwards WMI events to nl80211
> testmode. Non-UTF events can therefore be delivered to userspace and
> confuse FTM tools which expect only UTF responses.
> 
> Only forward known UTF event IDs from WMI event namespaces that route
> events through ath10k_tm_event_wmi(), and drop other WMI events while UTF
> monitor is active. READY events are still handled by the normal WMI
> receive path.
> 
> [...]

Applied, thanks!

[1/1] wifi: ath10k: filter non-UTF testmode events
      commit: 35a3da9fe1b212a9012952a04f383b8dc3708dd7

Best regards,
-- 
Jeff Johnson <jeff.johnson@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-01 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-30  2:32 [PATCH ath-next] wifi: ath10k: filter non-UTF testmode events Linghui Wu
2026-07-31  1:41 ` Baochen Qiang
2026-07-31  5:54 ` Rameshkumar Sundaram
2026-08-01 15:55 ` Jeff Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®