diff options
| author | Zhao Li <enderaoelyther@gmail.com> | 2026-06-12 21:37:18 +0800 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2026-07-06 12:28:25 +0200 |
| commit | b44371fc4d16d95f17b005f5bdedd8d4cb6de704 (patch) | |
| tree | a0ed9c0e446270c0290b34fe2e09288221607c95 | |
| parent | 991779e787d304e7594814711133c60732312bd8 (diff) | |
| download | linux-next-b44371fc4d16d95f17b005f5bdedd8d4cb6de704.tar.gz linux-next-b44371fc4d16d95f17b005f5bdedd8d4cb6de704.zip | |
wifi: cfg80211: reject empty PMSR peer lists
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>
Link: https://patch.msgid.link/20260612133717.93783-2-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| -rw-r--r-- | net/wireless/pmsr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c index 34ecbc6644a3..34c3625f7fd5 100644 --- a/net/wireless/pmsr.c +++ b/net/wireless/pmsr.c @@ -444,6 +444,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; |
