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

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

 



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