Skip to contentSkip to conversation

crypto:drbg- Fixes panic in wait_for_completion call.

PATCH In review Harsh Jain 3 participants 6 messages May 25, 2017 – Jun 22, 2017 Crypto API

lore
Share & tools
lore

Harsh Jain

author
#0 lore raw

PATCH 1/1 crypto:drbg- Fixes panic in wait_for_completion call.

Initialise ctr_completion variable before use.

---
 crypto/drbg.c |    1 +
 1 file changed, 1 insertion(+)
crypto/drbg.c +1 -0
index fa749f4..f1db29d 100644
@@ -1840,6 +1840,7 @@ static int drbg_kcapi_init(struct crypto_tfm *tfm)
     struct drbg_state *drbg = crypto_tfm_ctx(tfm);
 
     mutex_init(&drbg->drbg_mutex);
+    init_completion(&drbg->ctr_completion);
 
     return 0;
 }
Signature · 1 line
1.7.10.1
#1 lore raw

Am Donnerstag, 25. Mai 2017, 17:23:47 CEST schrieb Harsh Jain:

Hi Harsh,

Quoted 1 line

Initialise ctr_completion variable before use.

Thank you very much for catching this.

But I think the chosen function is wrong. When we have an HMAC or Hash DRBG, this completion function does not need to be initialized.

May I ask you to check this patch?

Ciao
Stephan

---8<---

Quoted 1 line

From 1ec5f753644eb9005ad758c9bfd75032602c9727 Mon Sep 17 00:00:00 2001

From: Stephan Mueller <[email protected]>
Date: Fri, 26 May 2017 12:11:31 +0200
Subject: [PATCH] crypto: drbg- Fixes panic in wait_for_completion call

Initialise ctr_completion variable before use.

---
 crypto/drbg.c | 1 +
 1 file changed, 1 insertion(+)
crypto/drbg.c +1 -0
index fa749f4..433c425 100644
@@ -1691,6 +1691,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg)
 		return PTR_ERR(sk_tfm);
 	}
 	drbg->ctr_handle = sk_tfm;
+	init_completion(&drbg->ctr_completion);
 
 	req = skcipher_request_alloc(sk_tfm, GFP_KERNEL);
 	if (!req) {
Signature · 1 line
2.9.3
author
#2 lore raw
Quoted 11 lines · Stephan Müller

Am Donnerstag, 25. Mai 2017, 17:23:47 CEST schrieb Harsh Jain:

Hi Harsh,

Quoted 1 line

Initialise ctr_completion variable before use.

Thank you very much for catching this.

But I think the chosen function is wrong. When we have an HMAC or Hash DRBG, this completion function does not need to be initialized.

May I ask you to check this patch?

Yup, Its working.

Quoted 35 lines

Ciao
Stephan

---8<---

From 1ec5f753644eb9005ad758c9bfd75032602c9727 Mon Sep 17 00:00:00 2001
From: Stephan Mueller <[email protected]>
Date: Fri, 26 May 2017 12:11:31 +0200
Subject: [PATCH] crypto: drbg- Fixes panic in wait_for_completion call

Initialise ctr_completion variable before use.

---
 crypto/drbg.c | 1 +
 1 file changed, 1 insertion(+)
crypto/drbg.c +1 -1
index fa749f4..433c425 100644
@@ -1691,6 +1691,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg)
                return PTR_ERR(sk_tfm);
        }
        drbg->ctr_handle = sk_tfm;
+       init_completion(&drbg->ctr_completion);
 
        req = skcipher_request_alloc(sk_tfm, GFP_KERNEL);
        if (!req) {
--

2.9.3

maintainer
#3 lore raw
In reply to Stephan Müller
Quoted 11 lines · Stephan Müller

Am Donnerstag, 25. Mai 2017, 17:23:47 CEST schrieb Harsh Jain:

Hi Harsh,

Quoted 1 line

Initialise ctr_completion variable before use.

Thank you very much for catching this.

But I think the chosen function is wrong. When we have an HMAC or Hash DRBG, this completion function does not need to be initialized.

May I ask you to check this patch?

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
author
#4 lore raw

Hi Herbert,

Since It's a panic BUG. Can we push this fix to stable kernel releases?

Regards
Harsh Jain

Quoted 18 lines · Herbert Xu
Quoted 11 lines · Stephan Müller

Am Donnerstag, 25. Mai 2017, 17:23:47 CEST schrieb Harsh Jain:

Hi Harsh,

Quoted 1 line

Initialise ctr_completion variable before use.

Thank you very much for catching this.

But I think the chosen function is wrong. When we have an HMAC or Hash DRBG, this completion function does not need to be initialized.

May I ask you to check this patch?

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

maintainer
#5 lore raw
Quoted 3 lines · Harsh Jain

Hi Herbert,

Since It's a panic BUG. Can we push this fix to stable kernel releases?

I have added it to crypto with a stable CC.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt