Skip to content

Commit

Permalink
mac80211: fix use after free
Browse files Browse the repository at this point in the history
roc is destroyed then roc->started is referenced. Keep a local cache.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Alan Cox authored and Johannes Berg committed Jul 13, 2012
1 parent ae33bd8 commit 4b4b822
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/mac80211/offchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ void ieee80211_sw_roc_work(struct work_struct *work)
container_of(work, struct ieee80211_roc_work, work.work);
struct ieee80211_sub_if_data *sdata = roc->sdata;
struct ieee80211_local *local = sdata->local;
bool started;

mutex_lock(&local->mtx);

Expand Down Expand Up @@ -366,9 +367,10 @@ void ieee80211_sw_roc_work(struct work_struct *work)
/* finish this ROC */
finish:
list_del(&roc->list);
started = roc->started;
ieee80211_roc_notify_destroy(roc);

if (roc->started) {
if (started) {
drv_flush(local, false);

local->tmp_channel = NULL;
Expand All @@ -379,7 +381,7 @@ void ieee80211_sw_roc_work(struct work_struct *work)

ieee80211_recalc_idle(local);

if (roc->started)
if (started)
ieee80211_start_next_roc(local);
}

Expand Down

0 comments on commit 4b4b822

Please sign in to comment.