Thread (4 messages) 4 messages, 2 authors, 2017-12-01

Re: KASAN: stack-out-of-bounds Write in sha3_update

flat view

From: Eric Biggers <hidden>
Date: 2017-11-29 01:53:55
Also in: lkml

On Tue, Nov 28, 2017 at 12:58:45PM -0800, Eric Biggers wrote:
quoted hunk ↗ jump to hunk
diff --git a/crypto/hmac.c b/crypto/hmac.c
index 92871dc2a63e..82436db6b6a6 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -196,6 +196,11 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)
 	if (IS_ERR(salg))
 		return PTR_ERR(salg);
 
+	/* The underlying hash algorithm must be unkeyed */
+	err = -EINVAL;
+	if (crypto_shash_alg_has_setkey(salg))
+		goto out_put_alg;
+
 	err = -EINVAL;
 	ds = salg->digestsize;
 	ss = salg->statesize;
I messed this up; it needs to initialize 'alg' first.  I'll send a fixed
version.

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