]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mac80211: fix remain-on-channel cancel crash
authorJohannes Berg <johannes.berg@intel.com>
Mon, 25 Mar 2013 10:51:14 +0000 (11:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Apr 2013 16:52:07 +0000 (09:52 -0700)
commit5c4a5a843043493ee5ddd9978517c4357a7245ee
tree6202f7aabd67e24da67990e61ec55d913d827faf
parent86489ad1d0346c94a575c2e370a57d3ffb9bd2ad
mac80211: fix remain-on-channel cancel crash

commit 3fbd45ca8d1c98f3c2582ef8bc70ade42f70947b upstream.

If a ROC item is canceled just as it expires, the work
struct may be scheduled while it is running (and waiting
for the mutex). This results in it being run after being
freed, which obviously crashes.

To fix this don't free it when aborting is requested but
instead mark it as "to be freed", which makes the work a
no-op and allows freeing it outside.

Reported-by: Jouni Malinen <j@w1.fi>
Tested-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/offchannel.c