diff mbox series

nl80211: ignore the length of hide ssid is zero in scan

Message ID 20210128115652.8564-1-samirweng1979@163.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series nl80211: ignore the length of hide ssid is zero in scan | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

samirweng1979 Jan. 28, 2021, 11:56 a.m. UTC
From: wengjianfeng <wengjianfeng@yulong.com>

If the length of hide ssid is zero in scan, don't pass
it to driver, which doesn't make any sense.

Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
---
 net/wireless/nl80211.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Johannes Berg Jan. 28, 2021, 11:59 a.m. UTC | #1
On Thu, 2021-01-28 at 19:56 +0800, samirweng1979 wrote:
> From: wengjianfeng <wengjianfeng@yulong.com>
> 
> If the length of hide ssid is zero in scan, don't pass
> it to driver, which doesn't make any sense.

Err, please check again how scanning works. This is quite obviously
intentional.

johannes
diff mbox series

Patch

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 775d0c4..d62e2aa 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -8727,6 +8727,9 @@  static int nl80211_abort_scan(struct sk_buff *skb, struct genl_info *info)
 				err = -EINVAL;
 				goto out_free;
 			}
+			/* ignore the length of hide ssid is zero */
+			if (nla_len(attr) == 0)
+				continue;
 			request->ssids[i].ssid_len = nla_len(attr);
 			memcpy(request->ssids[i].ssid, nla_data(attr),
 			       nla_len(attr));