[PATCH] net/lib80211: scrubbing the buffer for key

Subsystems: 802.11 (including cfg80211/nl80211), the rest

STALE2519d

2 messages, 2 authors, 2019-10-18 · open the first message on its own page

[PATCH] net/lib80211: scrubbing the buffer for key

From: Kangjie Lu <hidden>
Date: 2019-10-18 05:00:29

The "key" is not scrubbed. As what peer modules do, the fixes zeros
out the key buffer.

Signed-off-by: Kangjie Lu <redacted>
---
 net/wireless/lib80211_crypt_wep.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/net/wireless/lib80211_crypt_wep.c b/net/wireless/lib80211_crypt_wep.c
index dafc6f3571db..08e511aaa1ff 100644
--- a/net/wireless/lib80211_crypt_wep.c
+++ b/net/wireless/lib80211_crypt_wep.c
@@ -202,6 +202,7 @@ static int lib80211_wep_set_key(void *key, int len, u8 * seq, void *priv)
 	if (len < 0 || len > WEP_KEY_LEN)
 		return -1;
 
+	memset(wep, 0, sizeof(*wep));
 	memcpy(wep->key, key, len);
 	wep->key_len = len;
 
-- 
2.17.1

Re: [PATCH] net/lib80211: scrubbing the buffer for key

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2019-10-18 08:43:27

On Thu, 2019-10-17 at 23:53 -0500, Kangjie Lu wrote:
The "key" is not scrubbed. As what peer modules do, the fixes zeros
out the key buffer.
Why do you think this is useful/necessary? Please always describe that
in the commit log.

FWIW, I'm convinced that it's not at necessary at all, looking at how
this is allocated ...

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help