Skip to contentSkip to conversation

net/lib80211: scrubbing the buffer for key

PATCH In review Kangjie Lu 2 participants 2 messages Oct 18, 2019

Subsystems (3)
lore
Share & tools
lore

Kangjie Lu

author
#0 lore raw

PATCH 1/1 net/lib80211: scrubbing the buffer for key

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

---
 net/wireless/lib80211_crypt_wep.c | 1 +
 1 file changed, 1 insertion(+)
net/wireless/lib80211_crypt_wep.c +1 -0
index dafc6f3571db..08e511aaa1ff 100644
@@ -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;
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 2 lines · Kangjie Lu

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