cfg80211: regulatory: reject invalid hints

Reject invalid hints early in order to not cause a kernel
WARN later if they're restored to or similar.

Reported-by: [email protected]
Link: https://syzkaller.appspot.com/bug?extid=d451401ffd00a60677ee
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
Johannes Berg
2020-08-27 10:53:14 +02:00
parent 3579994476
commit 47caf685a6
+3
View File
@@ -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;