Skip to content

Commit 7d37fcd

Browse files
committed
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 <[email protected]>
1 parent 959eb2f commit 7d37fcd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/mac80211/offchannel.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,9 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
697697
struct ieee80211_roc_work *roc, *tmp, *found = NULL;
698698
int ret;
699699

700+
if (!cookie)
701+
return -ENOENT;
702+
700703
mutex_lock(&local->mtx);
701704
list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
702705
if (!mgmt_tx && roc->cookie != cookie)

0 commit comments

Comments
 (0)