1
0
Fork 0

cfg80211: regulatory: reject invalid hints

commit 47caf685a6 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Johannes Berg 2020-08-19 10:46:48 +02:00 committed by Greg Kroah-Hartman
parent 08eeec4452
commit 58c3e86d42
1 changed files with 3 additions and 0 deletions

View File

@ -2941,6 +2941,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;