mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
cfg80211: fix double-free after changing network namespace
[ Upstream commit 56cb31e185 ]
If wdev->wext.keys was initialized it didn't get reset to NULL on
unregister (and it doesn't get set in cfg80211_init_wdev either), but
wdev is reused if unregister was triggered through
cfg80211_switch_netns.
The next unregister (for whatever reason) will try to free
wdev->wext.keys again.
Signed-off-by: Stefan Bühler <source@stbuehler.de>
Link: https://lore.kernel.org/r/20191126100543.782023-1-stefan.buehler@tik.uni-stuttgart.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a6fdd8858c
commit
2d68f35b7b
@@ -1102,6 +1102,7 @@ static void __cfg80211_unregister_wdev(struct wireless_dev *wdev, bool sync)
|
||||
|
||||
#ifdef CONFIG_CFG80211_WEXT
|
||||
kzfree(wdev->wext.keys);
|
||||
wdev->wext.keys = NULL;
|
||||
#endif
|
||||
/* only initialized if we have a netdev */
|
||||
if (wdev->netdev)
|
||||
|
||||
Reference in New Issue
Block a user