Discussion:
[PATCH] mac80211: don't remove tainted keys after not programming
Johannes Berg
2014-10-22 09:30:51 UTC
Permalink
From: Johannes Berg <johannes.berg-***@public.gmane.org>

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-***@public.gmane.org>
---
net/mac80211/key.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

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)

might_sleep();

- if (key->flags & KEY_FLAG_TAINTED)
+ if (key->flags & KEY_FLAG_TAINTED) {
+ /* If we get here, it's during resume and the key is
+ * tainted so shouldn't be used/programmed any more.
+ * However, its flags may still indicate that it was
+ * programmed into the device (since we're in resume)
+ * so clear that flag now to avoid trying to remove
+ * it again later.
+ */
+ key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
return -EINVAL;
+ }

if (!key->local->ops->set_key)
goto out_unsupported;
--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Continue reading on narkive:
Search results for '[PATCH] mac80211: don't remove tainted keys after not programming' (Questions and Answers)
38
replies
Is Hannity, Limbaugh, Beck, Scarborough, O'Reilly, Fox News and the likes racist?
started 2008-10-23 07:07:59 UTC
politics
Loading...