All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.
@ 2017-05-25 15:23 Harsh Jain
  2017-05-26 10:12 ` Stephan Müller
  0 siblings, 1 reply; 6+ messages in thread
From: Harsh Jain @ 2017-05-25 15:23 UTC (permalink / raw)
  To: Herbert Xu, Stephan Mueller; +Cc: linux-crypto


Initialise ctr_completion variable before use.

Signed-off-by: Harsh Jain <harshjain.prof@gmail.com>
---
 crypto/drbg.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/crypto/drbg.c b/crypto/drbg.c
index fa749f4..f1db29d 100644
--- a/crypto/drbg.c
+++ b/crypto/drbg.c
@@ -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;
 }
-- 
1.7.10.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.
  2017-05-25 15:23 [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call Harsh Jain
@ 2017-05-26 10:12 ` Stephan Müller
  2017-05-26 10:39   ` Harsh Jain
  2017-06-10  4:17   ` Herbert Xu
  0 siblings, 2 replies; 6+ messages in thread
From: Stephan Müller @ 2017-05-26 10:12 UTC (permalink / raw)
  To: Harsh Jain; +Cc: Herbert Xu, linux-crypto

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

Hi Harsh,

> 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<---

>From 1ec5f753644eb9005ad758c9bfd75032602c9727 Mon Sep 17 00:00:00 2001
From: Stephan Mueller <smueller@chronox.de>
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.

Signed-off-by: Harsh Jain <harshjain.prof@gmail.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
 crypto/drbg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/crypto/drbg.c b/crypto/drbg.c
index fa749f4..433c425 100644
--- a/crypto/drbg.c
+++ b/crypto/drbg.c
@@ -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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.
  2017-05-26 10:12 ` Stephan Müller
@ 2017-05-26 10:39   ` Harsh Jain
  2017-06-10  4:17   ` Herbert Xu
  1 sibling, 0 replies; 6+ messages in thread
From: Harsh Jain @ 2017-05-26 10:39 UTC (permalink / raw)
  To: Stephan Müller; +Cc: Herbert Xu, linux-crypto

On Fri, May 26, 2017 at 3:42 PM, Stephan Müller <smueller@chronox.de> wrote:
> Am Donnerstag, 25. Mai 2017, 17:23:47 CEST schrieb Harsh Jain:
>
> Hi Harsh,
>
>> 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.
>
> Ciao
> Stephan
>
> ---8<---
>
> From 1ec5f753644eb9005ad758c9bfd75032602c9727 Mon Sep 17 00:00:00 2001
> From: Stephan Mueller <smueller@chronox.de>
> 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.
>
> Signed-off-by: Harsh Jain <harshjain.prof@gmail.com>
> Signed-off-by: Stephan Mueller <smueller@chronox.de>
> ---
>  crypto/drbg.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/crypto/drbg.c b/crypto/drbg.c
> index fa749f4..433c425 100644
> --- a/crypto/drbg.c
> +++ b/crypto/drbg.c
> @@ -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
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.
  2017-05-26 10:12 ` Stephan Müller
  2017-05-26 10:39   ` Harsh Jain
@ 2017-06-10  4:17   ` Herbert Xu
  2017-06-12  6:30     ` Harsh Jain
  1 sibling, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2017-06-10  4:17 UTC (permalink / raw)
  To: Stephan Müller; +Cc: Harsh Jain, linux-crypto

On Fri, May 26, 2017 at 12:12:51PM +0200, Stephan Müller wrote:
> Am Donnerstag, 25. Mai 2017, 17:23:47 CEST schrieb Harsh Jain:
> 
> Hi Harsh,
> 
> > 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 <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.
  2017-06-10  4:17   ` Herbert Xu
@ 2017-06-12  6:30     ` Harsh Jain
  2017-06-22  8:59       ` Herbert Xu
  0 siblings, 1 reply; 6+ messages in thread
From: Harsh Jain @ 2017-06-12  6:30 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Stephan Müller, linux-crypto

Hi Herbert,

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

Regards
Harsh Jain

On Sat, Jun 10, 2017 at 9:47 AM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Fri, May 26, 2017 at 12:12:51PM +0200, Stephan Müller wrote:
>> Am Donnerstag, 25. Mai 2017, 17:23:47 CEST schrieb Harsh Jain:
>>
>> Hi Harsh,
>>
>> > 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 <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.
  2017-06-12  6:30     ` Harsh Jain
@ 2017-06-22  8:59       ` Herbert Xu
  0 siblings, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2017-06-22  8:59 UTC (permalink / raw)
  To: Harsh Jain; +Cc: Stephan Müller, linux-crypto

On Mon, Jun 12, 2017 at 12:00:49PM +0530, Harsh Jain wrote:
> 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,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-22  8:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-25 15:23 [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call Harsh Jain
2017-05-26 10:12 ` Stephan Müller
2017-05-26 10:39   ` Harsh Jain
2017-06-10  4:17   ` Herbert Xu
2017-06-12  6:30     ` Harsh Jain
2017-06-22  8:59       ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.