RE: sha1_mb broken

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: Stephan Mueller [mailto:smueller@xxxxxxxxxx] 
Sent: Wednesday, September 28, 2016 10:31 PM
To: Dey, Megha <megha.dey@xxxxxxxxx>
Cc: linux-crypto@xxxxxxxxxxxxxxx; tim.c.chen@xxxxxxxxxxxxxxx
Subject: Re: sha1_mb broken

Am Mittwoch, 28. September 2016, 22:52:46 CEST schrieb Dey, Megha:

Hi Megha,

see a self contained example code attached.
 
> Hi Stephan,
>
> Your test code initialized the completion structure incorrectly, that led to the missing completion from being received. The init_completion call should be made before the crypto_ahash_digest call. The following change to your test code fixes things. ( I have also fixed what I believe is a typo aead->ahash)

> @@ -74,6 +74,8 @@ static unsigned int kccavs_ahash_op(struct kccavs_ahash_def *ahash)
> {
>        int rc = 0;
>
> +       init_completion(&ahash->result.completion);
> +
>        rc = crypto_ahash_digest(ahash->req);
>
>        switch (rc) {
>@@ -84,7 +86,7 @@ static unsigned int kccavs_ahash_op(struct kccavs_ahash_def *ahash)
>                rc = wait_for_completion_interruptible(&ahash->result.completion);
>                if (!rc && !ahash->result.err) {
> #ifdef OLDASYNC
> -                       INIT_COMPLETION(aead->result.completion);
> +                       INIT_COMPLETION(&ahash->result.completion);
> #else
>                       reinit_completion(&ahash->result.completion);
> #endif
> @@ -95,7 +97,6 @@ static unsigned int kccavs_ahash_op(struct kccavs_ahash_def *ahash)
>                    " %d\n",rc, ahash->result.err);
>                break;
>       }
> -       init_completion(&ahash->result.completion);
>
>     return rc;
>}
> This initialization of the completion structure happens correctly in the tcrypt test module used by the kernel, hence I did not come across this issue earlier.
> Thanks,
> Megha
Ciao
Stephan
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux