Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1492347

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

From Jan Stancek <jstancek@redhat.com>
Newsgroups linux.kernel
Subject Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7
Date 2016-09-28 11:00 +0200
Message-ID <smiSC-4tf-7@gated-at.bofh.it> (permalink)
References (3 earlier) <slIcp-6Mu-15@gated-at.bofh.it> <slQWl-4bJ-5@gated-at.bofh.it> <slWyJ-7CX-19@gated-at.bofh.it> <slZmW-Vl-35@gated-at.bofh.it> <sm6y5-5bY-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> Jan,
> 
> Can you check if the problem occurs with this patch?

No issues in over-night test with this patch.

> --- a/drivers/crypto/vmx/vmx.c
> +++ b/drivers/crypto/vmx/vmx.c
> @@ -28,6 +28,8 @@
>  #include <asm/cputable.h>
>  #include <crypto/internal/hash.h>
>  
> +int p8_ghash_fallback_descsize(void);
> +
>  extern struct shash_alg p8_ghash_alg;
>  extern struct crypto_alg p8_aes_alg;
>  extern struct crypto_alg p8_aes_cbc_alg;
> @@ -45,6 +47,7 @@ int __init p8_init(void)
>  {
>  	int ret = 0;
>  	struct crypto_alg **alg_it;
> +	int ghash_descsize;
>  
>  	for (alg_it = algs; *alg_it; alg_it++) {
>  		ret = crypto_register_alg(*alg_it);
> @@ -59,6 +62,12 @@ int __init p8_init(void)
>  	if (ret)
>  		return ret;
>  
> +	ghash_descsize = p8_ghash_fallback_descsize();
> +	if (ghash_descsize < 0) {
> +		printk(KERN_ERR "Cannot get descsize for p8_ghash fallback\n");
> +		return ghash_descsize;
> +	}
> +	p8_ghash_alg.descsize += ghash_descsize;
>  	ret = crypto_register_shash(&p8_ghash_alg);
>  	if (ret) {
>  		for (alg_it = algs; *alg_it; alg_it++)

I'd suggest to move this inside vmx/ghash.c to a new function, so all p8_ghash
related code is at single place. Then p8_init() would just call the new
function:
-    ret = crypto_register_shash(&p8_ghash_alg);
+    ret = register_p8_ghash();

Regards,
Jan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Jan Stancek <jstancek@redhat.com> - 2016-09-24 02:30 +0200
  Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-26 16:20 +0200
    Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Jan Stancek <jstancek@redhat.com> - 2016-09-26 20:00 +0200
  Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-26 17:10 +0200
    Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-26 19:50 +0200
      Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-27 05:10 +0200
        Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Jan Stancek <jstancek@redhat.com> - 2016-09-27 11:10 +0200
          Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-27 14:10 +0200
            Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-27 21:50 +0200
              Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-28 04:50 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Jan Stancek <jstancek@redhat.com> - 2016-09-28 09:50 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-28 14:40 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-28 14:50 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-28 15:00 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-28 15:20 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-28 14:40 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Marcelo Cerri <marcelo.cerri@canonical.com> - 2016-09-28 14:30 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-28 14:40 +0200
                Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> - 2016-09-28 15:30 +0200
              Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Jan Stancek <jstancek@redhat.com> - 2016-09-28 11:00 +0200
          Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7 Herbert Xu <herbert@gondor.apana.org.au> - 2016-09-28 04:50 +0200

csiph-web