Skip to contentSkip to conversation

crypto: tcrypt: Zero iv before freeing it

PATCH In review Codarren Velvindron 2 participants 3 messages Apr 23, 2017 – Apr 24, 2017 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: tcrypt: Zero iv before freeing it

---
 crypto/tcrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/tcrypt.c +1 -1
index 9a11f3c..48a721c 100644
@@ -384,7 +384,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
 out_noaxbuf:
 	testmgr_free_buf(xbuf);
 out_noxbuf:
-	kfree(iv);
+	kzfree(iv);
 	return;
 }
 
Signature · 1 line
2.7.4
#1 lore raw

Am Sonntag, 23. April 2017, 18:12:04 CEST schrieb Codarren Velvindron:

Hi Codarren,

Quoted 11 lines
---
 crypto/tcrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/tcrypt.c +0 -0
index 9a11f3c..48a721c 100644
@@ -384,7 +384,7 @@ static void test_aead_speed(const char *algo, int enc,

unsigned int secs, out_noaxbuf:

crypto/tcrypt.c static void test_aead_speed(const char *algo, int enc, unsigned int secs, · line 387

Quoted 4 lines
crypto/tcrypt.c +1 -1
 	testmgr_free_buf(xbuf);
 out_noxbuf:
-	kfree(iv);
+	kzfree(iv);

Why would you think this is needed?

       if (iv_len)
              memset(iv, 0xff, iv_len);

Ciao
Stephan

#2 lore raw
Quoted 22 lines · Stephan Müller

Am Sonntag, 23. April 2017, 18:12:04 CEST schrieb Codarren Velvindron:

Hi Codarren,

Quoted 11 lines
---
 crypto/tcrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/tcrypt.c +0 -0
index 9a11f3c..48a721c 100644
@@ -384,7 +384,7 @@ static void test_aead_speed(const char *algo, int enc,

unsigned int secs, out_noaxbuf:

crypto/tcrypt.c static void test_aead_speed(const char *algo, int enc, unsigned int secs, · line 387

Quoted 4 lines
crypto/tcrypt.c +1 -1
 	testmgr_free_buf(xbuf);
 out_noxbuf:
-	kfree(iv);
+	kzfree(iv);

Why would you think this is needed?

Quoted 6 lines
       if (iv_len)
              memset(iv, 0xff, iv_len);

Ciao
Stephan

Hello,

Thanks for bringing this up to my attention.

Kindly disregard the patch.

Best Regards,
Codarren