* [PATCH] wifi: cfg80211: reject empty PMSR peer lists
@ 2026-06-12 13:37 Zhao Li
0 siblings, 0 replies; only message in thread
From: Zhao Li @ 2026-06-12 13:37 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, linux-kernel
A PMSR request with an empty peers array is not a useful request and
weakens the cfg80211-to-driver contract by allowing start_pmsr() with
no target peer.
Reject empty peer lists before allocating the request object or calling
into the driver.
Fixes: 9bb7e0f24e7e7 ("cfg80211: add peer measurement with FTM initiator API")
Assisted-by: Codex:gpt-5.5
Assisted-by: Claude:claude-opus-4.8
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
---
net/wireless/pmsr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index d6cd0de64d1f8..3bf2b2d2546d4 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -313,6 +313,11 @@ int nl80211_pmsr_start(struct sk_buff *skb, struct genl_info *info)
}
}
+ if (!count) {
+ NL_SET_ERR_MSG_ATTR(info->extack, peers, "No peers specified");
+ return -EINVAL;
+ }
+
req = kzalloc_flex(*req, peers, count);
if (!req)
return -ENOMEM;
--
2.50.1 (Apple Git-155)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-12 13:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 13:37 [PATCH] wifi: cfg80211: reject empty PMSR peer lists Zhao Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox