Re: [PATCH RFC v4 17/42] crypto: kmsan: disable accelerated configs under KMSAN

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

 



On Fri, Dec 20, 2019 at 07:49:30PM +0100, glider@xxxxxxxxxx wrote:
> KMSAN is unable to understand when initialized values come from assembly.
> Disable accelerated configs in KMSAN builds to prevent false positive
> reports.
> 
> Signed-off-by: Alexander Potapenko <glider@xxxxxxxxxx>
> To: Alexander Potapenko <glider@xxxxxxxxxx>
> Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Vegard Nossum <vegard.nossum@xxxxxxxxxx>
> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> Cc: Marco Elver <elver@xxxxxxxxxx>
> Cc: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
> Cc: linux-mm@xxxxxxxxx
> 
> ---
> 
> v4:
>  - shorten comments as requested by Marco Elver
> 
> Change-Id: Iddc71a2a27360e036d719c0940ebf15553cf8de8
> ---
>  crypto/Kconfig | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/crypto/Kconfig b/crypto/Kconfig
> index 5575d48473bd..9c8074ed0f27 100644
> --- a/crypto/Kconfig
> +++ b/crypto/Kconfig
> @@ -321,11 +321,13 @@ config CRYPTO_AEGIS128_SIMD
>  	bool "Support SIMD acceleration for AEGIS-128"
>  	depends on CRYPTO_AEGIS128 && ((ARM || ARM64) && KERNEL_MODE_NEON)
>  	depends on !ARM || CC_IS_CLANG || GCC_VERSION >= 40800
> +	depends on !KMSAN # avoid false positives from assembly
>  	default y
>  
>  config CRYPTO_AEGIS128_AESNI_SSE2
>  	tristate "AEGIS-128 AEAD algorithm (x86_64 AESNI+SSE2 implementation)"
>  	depends on X86 && 64BIT
> +	depends on !KMSAN # avoid false positives from assembly
>  	select CRYPTO_AEAD
>  	select CRYPTO_SIMD
>  	help
> @@ -583,6 +585,7 @@ config CRYPTO_CRC32C
>  config CRYPTO_CRC32C_INTEL
>  	tristate "CRC32c INTEL hardware acceleration"
>  	depends on X86
> +	depends on !KMSAN # avoid false positives from assembly
>  	select CRYPTO_HASH
>  	help
>  	  In Intel processor with SSE4.2 supported, the processor will
> @@ -623,6 +626,7 @@ config CRYPTO_CRC32
>  config CRYPTO_CRC32_PCLMUL
>  	tristate "CRC32 PCLMULQDQ hardware acceleration"
>  	depends on X86
> +	depends on !KMSAN # avoid false positives from assembly
>  	select CRYPTO_HASH
>  	select CRC32
>  	help
> @@ -702,6 +706,7 @@ config CRYPTO_CRCT10DIF
>  config CRYPTO_CRCT10DIF_PCLMUL
>  	tristate "CRCT10DIF PCLMULQDQ hardware acceleration"
>  	depends on X86 && 64BIT && CRC_T10DIF
> +	depends on !KMSAN # avoid false positives from assembly
>  	select CRYPTO_HASH
>  	help
>  	  For x86_64 processors with SSE4.2 and PCLMULQDQ supported,
> @@ -751,6 +756,7 @@ config CRYPTO_POLY1305_X86_64
>  	depends on X86 && 64BIT
>  	select CRYPTO_LIB_POLY1305_GENERIC
>  	select CRYPTO_ARCH_HAVE_LIB_POLY1305
> +	depends on !KMSAN # avoid false positives from assembly
>  	help
>  	  Poly1305 authenticator algorithm, RFC7539.

Many of these 'depends on !KMSAN' lines are mixed in among 'select' lines.
They should go immediately after any existing 'depends on' lines.  E.g.

  	depends on X86 && 64BIT
 +	depends on !KMSAN # avoid false positives from assembly
  	select CRYPTO_LIB_POLY1305_GENERIC
  	select CRYPTO_ARCH_HAVE_LIB_POLY1305

Also, there are some options that were missed:

	CRYPTO_CURVE25519_X86
	CRYPTO_NHPOLY1305_SSE2
	CRYPTO_NHPOLY1305_AVX2
	CRYPTO_BLAKE2S_X86

- Eric




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux