Skip to content

Commit

Permalink
cfg80211: fix rcu in cfg80211_unregister_wdev
Browse files Browse the repository at this point in the history
Callers of cfg80211_unregister_wdev can free the wdev object
immediately after this function returns. This may crash the kernel
because this wdev object is still in use by other threads.
Add synchronize_rcu() after list_del_rcu to make sure wdev object can
be safely freed.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
  • Loading branch information
Dedy Lansky authored and Johannes Berg committed Jun 15, 2018
1 parent dc8b274 commit bf2b61a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev)
nl80211_notify_iface(rdev, wdev, NL80211_CMD_DEL_INTERFACE);

list_del_rcu(&wdev->list);
synchronize_rcu();
rdev->devlist_generation++;

switch (wdev->iftype) {
Expand Down

0 comments on commit bf2b61a

Please sign in to comment.