cfg80211: check regulatory request alpha2 early
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 5 Nov 2013 17:18:01 +0000 (09:18 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Nov 2013 19:51:02 +0000 (20:51 +0100)
Currently nl80211 allows userspace to send the kernel
a bogus regulatory domain with at most 32 rules set
and it won't reject it until after its allocated
memory. Let's be smart about it and take advantage
that the last_request is now available under RTNL
and check if the alpha2 matches an expected request
and reject any bogus userspace requests prior to
hitting the memory allocator.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c
net/wireless/reg.c
net/wireless/reg.h

Simple merge
Simple merge
Simple merge