projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3579994
)
cfg80211: regulatory: reject invalid hints
author
Johannes Berg
<johannes.berg@intel.com>
Wed, 19 Aug 2020 08:46:48 +0000
(10:46 +0200)
committer
Johannes Berg
<johannes.berg@intel.com>
Thu, 27 Aug 2020 08:53:14 +0000
(10:53 +0200)
Reject invalid hints early in order to not cause a kernel
WARN later if they're restored to or similar.
Reported-by: syzbot+d451401ffd00a60677ee@syzkaller.appspotmail.com
Link:
https://syzkaller.appspot.com/bug?extid=d451401ffd00a60677ee
Link:
https://lore.kernel.org/r/20200819084648.13956-1-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/reg.c
patch
|
blob
|
history
diff --git
a/net/wireless/reg.c
b/net/wireless/reg.c
index 35b8847a2f6d01f9ac046c038bb93ba830fe7ca1..d8a90d39742357ac8ea48f4e934185591f7310b0 100644
(file)
--- a/
net/wireless/reg.c
+++ b/
net/wireless/reg.c
@@
-2946,6
+2946,9
@@
int regulatory_hint_user(const char *alpha2,
if (WARN_ON(!alpha2))
return -EINVAL;
+ if (!is_world_regdom(alpha2) && !is_an_alpha2(alpha2))
+ return -EINVAL;
+
request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
if (!request)
return -ENOMEM;