mac80211_hwsim: validate number of different channels
authorJohannes Berg <johannes.berg@intel.com>
Mon, 15 Jan 2018 08:32:36 +0000 (09:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:07:45 +0000 (11:07 +0100)
commit447f1170c23bea791c3b5efdc0264519fd22f565
tree835d5b77c08701856fedf5f09fdfbf7f1daed401
parentb9e441e2e6346284120c9e8e24c4050c245b8895
mac80211_hwsim: validate number of different channels

commit 51a1aaa631c90223888d8beac4d649dc11d2ca55 upstream.

When creating a new radio on the fly, hwsim allows this
to be done with an arbitrary number of channels, but
cfg80211 only supports a limited number of simultaneous
channels, leading to a warning.

Fix this by validating the number - this requires moving
the define for the maximum out to a visible header file.

Reported-by: syzbot+8dd9051ff19940290931@syzkaller.appspotmail.com
Fixes: b59ec8dd4394 ("mac80211_hwsim: fix number of channels in interface combinations")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mac80211_hwsim.c
include/net/cfg80211.h
net/wireless/core.h