aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-10-13 07:43:29 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-22 05:30:30 -0400
commit4619194a49bfbbb03d20d4ca45c3eb1dc8297d9d (patch)
tree55b90997564602f237f2168a371bad73bebcdea4 /net/mac80211
parent02219b3abca59fca81711bfe7ee78df7abad97ce (diff)
mac80211: don't remove tainted keys after not programming
When a key is tainted during resume, it is no longer programmed into the device; however, it's uploaded flag may (will) be set. Clear the flag when not programming it because it's tainted to avoid attempting to remove it again later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/key.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 4712150dc210..434a91ad12c8 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -94,8 +94,17 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
94 94
95 might_sleep(); 95 might_sleep();
96 96
97 if (key->flags & KEY_FLAG_TAINTED) 97 if (key->flags & KEY_FLAG_TAINTED) {
98 /* If we get here, it's during resume and the key is
99 * tainted so shouldn't be used/programmed any more.
100 * However, its flags may still indicate that it was
101 * programmed into the device (since we're in resume)
102 * so clear that flag now to avoid trying to remove
103 * it again later.
104 */
105 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
98 return -EINVAL; 106 return -EINVAL;
107 }
99 108
100 if (!key->local->ops->set_key) 109 if (!key->local->ops->set_key)
101 goto out_unsupported; 110 goto out_unsupported;