diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-09-10 13:39:56 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-09-11 12:07:28 +0200 |
commit | 538c9eb8b3fd33d3a0722b2c04ec4f574eaa6e9f (patch) | |
tree | 738b71b941b78e7708c158eb79b7fabeddf480f4 /net/wireless | |
parent | 29c3f9c3996abea060fa6e0b9e6a30d3f0cc828c (diff) | |
download | op-kernel-dev-538c9eb8b3fd33d3a0722b2c04ec4f574eaa6e9f.zip op-kernel-dev-538c9eb8b3fd33d3a0722b2c04ec4f574eaa6e9f.tar.gz |
cfg80211: clear wext keys when freeing and removing them
When freeing the keys stored for wireless extensions, clear the memory
to avoid having the key material stick around in memory "forever".
Similarly, when userspace overwrites a key, actually clear it instead
of just setting the key length to zero.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 2 | ||||
-rw-r--r-- | net/wireless/wext-compat.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 9698fe70..55ec9be 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -1007,7 +1007,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, rdev->devlist_generation++; cfg80211_mlme_purge_registrations(wdev); #ifdef CONFIG_CFG80211_WEXT - kfree(wdev->wext.keys); + kzfree(wdev->wext.keys); #endif } /* diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 11120bb..0f47948 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -496,6 +496,8 @@ static int __cfg80211_set_encryption(struct cfg80211_registered_device *rdev, err = 0; if (!err) { if (!addr) { + memset(wdev->wext.keys->data[idx], 0, + sizeof(wdev->wext.keys->data[idx])); wdev->wext.keys->params[idx].key_len = 0; wdev->wext.keys->params[idx].cipher = 0; } |