staging: rtl8192e: initializing the wep buffer
PATCH 1/1 staging: rtl8192e: initializing the wep buffer
The "wep" buffer is not initialized. To avoid memory disclosures, the fix initializes it, as peer functions like rtllib_ccmp_set_key do.
Signed-off-by Kangjie Lu <[email protected]>
--- drivers/staging/rtl8192e/rtllib_crypt_wep.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/rtl8192e/rtllib_crypt_wep.c +1 -0
@@ -232,6 +232,7 @@ static int prism2_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
Quoted 14 lines · Kangjie Lu
The "wep" buffer is not initialized. To avoid memory disclosures, the fix initializes it, as peer functions like
rtllib_ccmp_set_keydo.Signed-off-by Kangjie Lu <[email protected]>--- drivers/staging/rtl8192e/rtllib_crypt_wep.c | 1 + 1 file changed, 1 insertion(+)drivers/staging/rtl8192e/rtllib_crypt_wep.c +0
-0
drivers/staging/rtl8192e/rtllib_crypt_wep.c static int prism2_wep_set_key(void *key, int len, u8 *seq, void *priv) · line 237
Quoted 6 lines
drivers/staging/rtl8192e/rtllib_crypt_wep.c +1
-0@@ -232,6 +232,7 @@ static int prism2_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;
If we read beyond wep->key_len then it's probably a bug, right? It doesn't matter whether it's zeroed out or not. Fortunately we never do:
memcpy(key, wep->key, wep->key_len);
So this change isn't required.
regards,
dan carpenter