lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250516122715.GCaCcvI7vq-DBzlNtK@fat_crate.local>
Date: Fri, 16 May 2025 14:27:15 +0200
From: Borislav Petkov <bp@...en8.de>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Ayush Jain <Ayush.Jain3@....com>,
	Stephen Rothwell <sfr@...b.auug.org.au>, x86-ml <x86@...nel.org>,
	lkml <linux-kernel@...r.kernel.org>, linux-crypto@...r.kernel.org,
	Eric Biggers <ebiggers@...gle.com>
Subject: Re: [PATCH] crypto: lib/sha256 - Disable SIMD

On Fri, May 16, 2025 at 07:48:52PM +0800, Herbert Xu wrote:
> On Fri, May 16, 2025 at 07:34:06PM +0800, Herbert Xu wrote:
> > 
> > So what's happened is that previously if you call sha256_update
> > from lib/crypto it would only use the generic C code to perform
> > the operation.
> > 
> > This has now been changed to automatically use SIMD instructions
> > which obviously blew up in your case.
> 
> In the interim you can go back to the old ways and disable SIMD
> for lib/crypto sha256 with this patch:
> 
> ---8<---
> Disable SIMD usage in lib/crypto sha256 as it is causing crashes.
> 
> Reported-by: Borislav Petkov <bp@...en8.de>

Please make that

Reported-by: Ayush Jain <Ayush.Jain3@....com>

I'm just the messenger.

> Fixes: 950e5c84118c ("crypto: sha256 - support arch-optimized lib and expose through shash")
> Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
> 
> diff --git a/include/crypto/internal/sha2.h b/include/crypto/internal/sha2.h
> index b9bccd3ff57f..e1b0308c0539 100644
> --- a/include/crypto/internal/sha2.h
> +++ b/include/crypto/internal/sha2.h
> @@ -32,7 +32,7 @@ static inline void sha256_choose_blocks(
>  	if (!IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_SHA256) || force_generic)
>  		sha256_blocks_generic(state, data, nblocks);
>  	else if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_SHA256_SIMD) &&
> -		 (force_simd || crypto_simd_usable()))
> +		 force_simd)
>  		sha256_blocks_simd(state, data, nblocks);
>  	else
>  		sha256_blocks_arch(state, data, nblocks);
> -- 

If you end up doing this, that fixes it, obviously:

Tested-by: Ayush Jain <Ayush.Jain3@....com>

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ