Skip to contentSkip to conversation

CIFS: fix sha512 check in cifs_crypto_secmech_release

PATCH Applied Gustavo A. R. Silva 4 participants 4 messages Feb 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CIFS: fix sha512 check in cifs_crypto_secmech_release

It seems this is a copy-paste error and that the proper variable to use in this particular case is _sha512_ instead of _md5_.

Addresses-Coverity-ID: 1465358 ("Copy-paste error")

Fixes 1c6614d229e7 ("CIFS: add sha512 secmech")
---
 fs/cifs/cifsencrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/cifsencrypt.c +1 -1
index 6fa6d45..a6ef088 100644
@@ -829,7 +829,7 @@ cifs_crypto_secmech_release(struct TCP_Server_Info *server)
 		server->secmech.md5 = NULL;
 	}
 
-	if (server->secmech.md5) {
+	if (server->secmech.sha512) {
 		crypto_free_shash(server->secmech.sha512);
 		server->secmech.sha512 = NULL;
 	}
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Gustavo A. R. Silva

It seems this is a copy-paste error and that the proper variable to use in this particular case is _sha512_ instead of _md5_.

*sigh* I re-read this a lot yet still missed it. Minor memory leak
fixed, good coverity catch and thanks for the fix!

Signature · 4 lines
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
#2 lore raw

Hi Aurélien,

Quoted 9 lines · Aurélien Aptel
Quoted 2 lines · Gustavo A. R. Silva

It seems this is a copy-paste error and that the proper variable to use in this particular case is _sha512_ instead of _md5_.

*sigh* I re-read this a lot yet still missed it. Minor memory leak
fixed, good coverity catch and thanks for the fix!

Glad to help. Thanks for the review.

BTW I think this should be sent to stable too.
--
Gustavo

Applied
#3 lore raw

merged into cifs-2.6.git for-next

Quoted 26 lines · Gustavo A. R. Silva

Hi Aurélien,

Quoted 12 lines · Aurélien Aptel
Quoted 3 lines · Gustavo A. R. Silva

It seems this is a copy-paste error and that the proper variable to use in this particular case is _sha512_ instead of _md5_.

*sigh* I re-read this a lot yet still missed it. Minor memory leak
fixed, good coverity catch and thanks for the fix!

Glad to help. Thanks for the review.

BTW I think this should be sent to stable too.
--
Gustavo

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Thanks,

Steve