mac80211: reject zero cookie in mgmt-tx/roc cancel
authorJohannes Berg <johannes.berg@intel.com>
Tue, 1 Dec 2015 22:15:26 +0000 (23:15 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 4 Dec 2015 13:43:32 +0000 (14:43 +0100)
commit7d37fcd409199f76da522e6f6670a354ac468002
tree6f645a02217b84c7b2a16147708a300985109f22
parent959eb2fd70df86a089e9e31be654462235952a24
mac80211: reject zero cookie in mgmt-tx/roc cancel

When cancelling, you can cancel "any" (first in list) mgmt-tx
or remain-on-channel operation by using the value 0 for the
cookie along with the *opposite* operation, i.e.
 * cancel the first mgmt-tx by cancelling roc with 0 cookie
 * cancel the first roc by cancelling mgmt-tx with 0 cookie

This isn't really that bad since userspace should only pass
cookies that we gave it, but could lead to hard-to-debug
issues so better prevent it and reject zero values since we
never hand those out.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/offchannel.c