mac80211_hwsim: check that n_limits makes sense
authorJohannes Berg <johannes.berg@intel.com>
Tue, 15 Jan 2019 13:24:23 +0000 (14:24 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Sat, 19 Jan 2019 08:10:30 +0000 (09:10 +0100)
commit9c5d3afac436beef91b7a6312068e9360c7d8446
treeb6ab5300c24d59f0a51d3bec421728768c0c8ab3
parent8a7fa0c35027d1a3ec3c3e8612800a1b4738e3c3
mac80211_hwsim: check that n_limits makes sense

Under certain circumstances, radios created via netlink could
have n_limits be zero and no possible interface types, which
makes no sense. Reject this early to prevent a WARN_ON() in
cfg80211.

Fixes: 99e3a44bac37 ("mac80211_hwsim: allow setting iftype support")
Reported-by: syzbot+73fd8b0aa60c67fa4b60@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c