Skip to content

Commit b16798f

Browse files
committed
mac80211: mark station unauthorized before key removal
If a station is still marked as authorized, mark it as no longer so before removing its keys. This allows frames transmitted to it to be rejected, providing additional protection against leaking plain text data during the disconnection flow. Cc: [email protected] Link: https://lore.kernel.org/r/20200326155133.ccb4fb0bb356.If48f0f0504efdcf16b8921f48c6d3bb2cb763c99@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent ce2e1ca commit b16798f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/mac80211/sta_info.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright 2006-2007 Jiri Benc <[email protected]>
55
* Copyright 2013-2014 Intel Mobile Communications GmbH
66
* Copyright (C) 2015 - 2017 Intel Deutschland GmbH
7-
* Copyright (C) 2018-2019 Intel Corporation
7+
* Copyright (C) 2018-2020 Intel Corporation
88
*/
99

1010
#include <linux/module.h>
@@ -1049,6 +1049,11 @@ static void __sta_info_destroy_part2(struct sta_info *sta)
10491049
might_sleep();
10501050
lockdep_assert_held(&local->sta_mtx);
10511051

1052+
while (sta->sta_state == IEEE80211_STA_AUTHORIZED) {
1053+
ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
1054+
WARN_ON_ONCE(ret);
1055+
}
1056+
10521057
/* now keys can no longer be reached */
10531058
ieee80211_free_sta_keys(local, sta);
10541059

0 commit comments

Comments
 (0)