From patchwork Fri Nov 22 11:26:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11257891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35DBD14DB for ; Fri, 22 Nov 2019 11:27:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E847320674 for ; Fri, 22 Nov 2019 11:27:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="A9ZDyZ4B" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E847320674 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C84836B04DF; Fri, 22 Nov 2019 06:27:18 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C34556B04E0; Fri, 22 Nov 2019 06:27:18 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFC7D6B04E1; Fri, 22 Nov 2019 06:27:18 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id 994326B04DF for ; Fri, 22 Nov 2019 06:27:18 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 5C7058249980 for ; Fri, 22 Nov 2019 11:27:18 +0000 (UTC) X-FDA: 76183687356.13.boys37_57a656528d2d X-Spam-Summary: 2,0,0,af44190a7459dfeb,d41d8cd98f00b204,3fmbxxqykcpmbgdyzmbjjbgz.xjhgdips-hhfqvxf.jmb@flex--glider.bounces.google.com,:herbert@gondor.apana.org.au:davem@davemloft.net:vegard.nossum@oracle.com:dvyukov@google.com::glider@google.com:viro@zeniv.linux.org.uk:adilger.kernel@dilger.ca:akpm@linux-foundation.org:andreyknvl@google.com:aryabinin@virtuozzo.com:luto@kernel.org:ard.biesheuvel@linaro.org:arnd@arndb.de:hch@infradead.org:hch@lst.de:darrick.wong@oracle.com:dmitry.torokhov@gmail.com:ebiggers@google.com:edumazet@google.com:ericvh@gmail.com:gregkh@linuxfoundation.org:harry.wentland@amd.com:iii@linux.ibm.com:mingo@elte.hu:jasowang@redhat.com:axboe@kernel.dk:m.szyprowski@samsung.com:elver@google.com:mark.rutland@arm.com:martin.petersen@oracle.com:schwidefsky@de.ibm.com:willy@infradead.org:mst@redhat.com:monstr@monstr.eu:pmladek@suse.com:cai@lca.pw:rdunlap@infradead.org:robin.murphy@arm.com:sergey.senozhatsky@gmail.com:rostedt@goodmis.org:tiwai@suse.com:tytso@mit.edu :tglx@li X-HE-Tag: boys37_57a656528d2d X-Filterd-Recvd-Size: 12805 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Nov 2019 11:27:17 +0000 (UTC) Received: by mail-wr1-f73.google.com with SMTP id j12so3724328wrw.15 for ; Fri, 22 Nov 2019 03:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=N+zL/FxYq0jNXv1SKI2RVAhIpHI8Tja3vObgnLlkd+Q=; b=A9ZDyZ4BCAh064eX+ga5n1Pn6kBd5K4v1XSUOxvcenU3+zRBL3vLc/RiwMmMu3366u tgB2BW9AN3AGCJid4FPIKlZD+J/+qG5+AI9qWuMrsw05U4yNwP31TCgjxdrmFS2vazka NGl7zhyAMbGjx4/vxJbJui2FpdB5JVe3avHq+pCY+66S14ZAD73fLL2w43rhA+qo41j2 zrI9CQ3KQ7ZrAtySzENoOlRKwr0PluGP8/lLzHqcOcHn9oG2Z4GHQSX7zuMKar71CfN8 Pyi3MT5NZ2YQmdCIBcU1WUFpTAkPVrvOIap8S7ax7Oed8DbadWVu4kC3BC4UNSqLXovj Bbsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=N+zL/FxYq0jNXv1SKI2RVAhIpHI8Tja3vObgnLlkd+Q=; b=jXvM2TGj340Pop0NKnNJmY9pl9opeXe+q4K5j/GQyC37eSNo4NHN+jg61CqoFx9bOl jmPEF8eclGCG3UnQ8qNyRNQEAAWYCQ7Xy66NXSS00iXR8Veeh1pDv6hpeg1G2S8fhnYx Lqs81UnNM7eB/Zc0bpF8n8iireX29bcMKYH7Y9ynMhU0i9vM29sqITQJBBaG2eNpv4hP IVWbxfMKTAO39Rm7lx4Bivlwws5ZSbLiWLaNFQgqGY3TwnqjfZsrPNRTE4cPEzu0Sftf VFmcdVVvY+yYZx2TZ4L8jgybmsn6mCFPzpVHTNigknE7OL/iK4stj7vEnuurpk0UFDF1 UdzA== X-Gm-Message-State: APjAAAX6FUjIjdg5ll4b9AkOxmsfJcz04GIsg3AfrImUACKYu/zyquvH 8NKAwuxcDyJSR1LJJvuacdAtypVGbD0= X-Google-Smtp-Source: APXvYqxGvyMmFYCRlAbAGi8V9/GNgN537mvd4kz4DyTliW2o6wam+t57xj67xRvE6pse4+fu/tdqpCxbAb8= X-Received: by 2002:adf:fe0c:: with SMTP id n12mr16824430wrr.174.1574422036176; Fri, 22 Nov 2019 03:27:16 -0800 (PST) Date: Fri, 22 Nov 2019 12:26:01 +0100 In-Reply-To: <20191122112621.204798-1-glider@google.com> Message-Id: <20191122112621.204798-17-glider@google.com> Mime-Version: 1.0 References: <20191122112621.204798-1-glider@google.com> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog Subject: [PATCH RFC v3 16/36] crypto: kmsan: disable accelerated configs under KMSAN From: glider@google.com To: Herbert Xu , "David S. Miller" , Vegard Nossum , Dmitry Vyukov , linux-mm@kvack.org Cc: glider@google.com, viro@zeniv.linux.org.uk, adilger.kernel@dilger.ca, akpm@linux-foundation.org, andreyknvl@google.com, aryabinin@virtuozzo.com, luto@kernel.org, ard.biesheuvel@linaro.org, arnd@arndb.de, hch@infradead.org, hch@lst.de, darrick.wong@oracle.com, dmitry.torokhov@gmail.com, ebiggers@google.com, edumazet@google.com, ericvh@gmail.com, gregkh@linuxfoundation.org, harry.wentland@amd.com, iii@linux.ibm.com, mingo@elte.hu, jasowang@redhat.com, axboe@kernel.dk, m.szyprowski@samsung.com, elver@google.com, mark.rutland@arm.com, martin.petersen@oracle.com, schwidefsky@de.ibm.com, willy@infradead.org, mst@redhat.com, monstr@monstr.eu, pmladek@suse.com, cai@lca.pw, rdunlap@infradead.org, robin.murphy@arm.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, tiwai@suse.com, tytso@mit.edu, tglx@linutronix.de, gor@linux.ibm.com, wsa@the-dreams.de X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 To: Alexander Potapenko Cc: Herbert Xu Cc: "David S. Miller" Cc: Vegard Nossum Cc: Dmitry Vyukov Cc: linux-mm@kvack.org --- Change-Id: Iddc71a2a27360e036d719c0940ebf15553cf8de8 --- crypto/Kconfig | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 9e524044d312..502a75f1b597 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -309,11 +309,15 @@ config CRYPTO_AEGIS128 config CRYPTO_AEGIS128_SIMD bool "Support SIMD acceleration for AEGIS-128" depends on CRYPTO_AEGIS128 && ((ARM || ARM64) && KERNEL_MODE_NEON) + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN default y config CRYPTO_AEGIS128_AESNI_SSE2 tristate "AEGIS-128 AEAD algorithm (x86_64 AESNI+SSE2 implementation)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_AEAD select CRYPTO_SIMD help @@ -571,6 +575,8 @@ config CRYPTO_CRC32C config CRYPTO_CRC32C_INTEL tristate "CRC32c INTEL hardware acceleration" depends on X86 + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_HASH help In Intel processor with SSE4.2 supported, the processor will @@ -611,6 +617,8 @@ config CRYPTO_CRC32 config CRYPTO_CRC32_PCLMUL tristate "CRC32 PCLMULQDQ hardware acceleration" depends on X86 + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_HASH select CRC32 help @@ -649,6 +657,8 @@ config CRYPTO_CRCT10DIF config CRYPTO_CRCT10DIF_PCLMUL tristate "CRCT10DIF PCLMULQDQ hardware acceleration" depends on X86 && 64BIT && CRC_T10DIF + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_HASH help For x86_64 processors with SSE4.2 and PCLMULQDQ supported, @@ -695,6 +705,8 @@ config CRYPTO_POLY1305 config CRYPTO_POLY1305_X86_64 tristate "Poly1305 authenticator algorithm (x86_64/SSE2/AVX2)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_POLY1305 help Poly1305 authenticator algorithm, RFC7539. @@ -814,6 +826,8 @@ config CRYPTO_SHA1 config CRYPTO_SHA1_SSSE3 tristate "SHA1 digest algorithm (SSSE3/AVX/AVX2/SHA-NI)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_SHA1 select CRYPTO_HASH help @@ -825,6 +839,8 @@ config CRYPTO_SHA1_SSSE3 config CRYPTO_SHA256_SSSE3 tristate "SHA256 digest algorithm (SSSE3/AVX/AVX2/SHA-NI)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_SHA256 select CRYPTO_HASH help @@ -837,6 +853,8 @@ config CRYPTO_SHA256_SSSE3 config CRYPTO_SHA512_SSSE3 tristate "SHA512 digest algorithm (SSSE3/AVX/AVX2)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_SHA512 select CRYPTO_HASH help @@ -1011,6 +1029,8 @@ config CRYPTO_WP512 config CRYPTO_GHASH_CLMUL_NI_INTEL tristate "GHASH hash function (CLMUL-NI accelerated)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_CRYPTD help This is the x86_64 CLMUL-NI accelerated implementation of @@ -1064,6 +1084,8 @@ config CRYPTO_AES_TI config CRYPTO_AES_NI_INTEL tristate "AES cipher algorithms (AES-NI)" depends on X86 + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_AEAD select CRYPTO_LIB_AES select CRYPTO_ALGAPI @@ -1190,6 +1212,8 @@ config CRYPTO_BLOWFISH_COMMON config CRYPTO_BLOWFISH_X86_64 tristate "Blowfish cipher algorithm (x86_64)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_BLOWFISH_COMMON help @@ -1221,6 +1245,8 @@ config CRYPTO_CAMELLIA_X86_64 tristate "Camellia cipher algorithm (x86_64)" depends on X86 && 64BIT depends on CRYPTO + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_GLUE_HELPER_X86 help @@ -1238,6 +1264,8 @@ config CRYPTO_CAMELLIA_AESNI_AVX_X86_64 tristate "Camellia cipher algorithm (x86_64/AES-NI/AVX)" depends on X86 && 64BIT depends on CRYPTO + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_CAMELLIA_X86_64 select CRYPTO_GLUE_HELPER_X86 @@ -1258,6 +1286,8 @@ config CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 tristate "Camellia cipher algorithm (x86_64/AES-NI/AVX2)" depends on X86 && 64BIT depends on CRYPTO + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_CAMELLIA_AESNI_AVX_X86_64 help Camellia cipher algorithm module (x86_64/AES-NI/AVX2). @@ -1303,6 +1333,8 @@ config CRYPTO_CAST5 config CRYPTO_CAST5_AVX_X86_64 tristate "CAST5 (CAST-128) cipher algorithm (x86_64/AVX)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_CAST5 select CRYPTO_CAST_COMMON @@ -1325,6 +1357,8 @@ config CRYPTO_CAST6 config CRYPTO_CAST6_AVX_X86_64 tristate "CAST6 (CAST-256) cipher algorithm (x86_64/AVX)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_CAST6 select CRYPTO_CAST_COMMON @@ -1360,6 +1394,8 @@ config CRYPTO_DES_SPARC64 config CRYPTO_DES3_EDE_X86_64 tristate "Triple DES EDE cipher algorithm (x86-64)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_LIB_DES help @@ -1426,6 +1462,8 @@ config CRYPTO_CHACHA20 config CRYPTO_CHACHA20_X86_64 tristate "ChaCha stream cipher algorithms (x86_64/SSSE3/AVX2/AVX-512VL)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_CHACHA20 help @@ -1462,6 +1500,8 @@ config CRYPTO_SERPENT config CRYPTO_SERPENT_SSE2_X86_64 tristate "Serpent cipher algorithm (x86_64/SSE2)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_GLUE_HELPER_X86 select CRYPTO_SERPENT @@ -1481,6 +1521,8 @@ config CRYPTO_SERPENT_SSE2_X86_64 config CRYPTO_SERPENT_SSE2_586 tristate "Serpent cipher algorithm (i586/SSE2)" depends on X86 && !64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_GLUE_HELPER_X86 select CRYPTO_SERPENT @@ -1500,6 +1542,8 @@ config CRYPTO_SERPENT_SSE2_586 config CRYPTO_SERPENT_AVX_X86_64 tristate "Serpent cipher algorithm (x86_64/AVX)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_GLUE_HELPER_X86 select CRYPTO_SERPENT @@ -1520,6 +1564,8 @@ config CRYPTO_SERPENT_AVX_X86_64 config CRYPTO_SERPENT_AVX2_X86_64 tristate "Serpent cipher algorithm (x86_64/AVX2)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_SERPENT_AVX_X86_64 help Serpent cipher algorithm, by Anderson, Biham & Knudsen. @@ -1615,6 +1661,8 @@ config CRYPTO_TWOFISH_586 config CRYPTO_TWOFISH_X86_64 tristate "Twofish cipher algorithm (x86_64)" depends on (X86 || UML_X86) && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_ALGAPI select CRYPTO_TWOFISH_COMMON help @@ -1631,6 +1679,8 @@ config CRYPTO_TWOFISH_X86_64 config CRYPTO_TWOFISH_X86_64_3WAY tristate "Twofish cipher algorithm (x86_64, 3-way parallel)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_TWOFISH_COMMON select CRYPTO_TWOFISH_X86_64 @@ -1652,6 +1702,8 @@ config CRYPTO_TWOFISH_X86_64_3WAY config CRYPTO_TWOFISH_AVX_X86_64 tristate "Twofish cipher algorithm (x86_64/AVX)" depends on X86 && 64BIT + # Disable under KMSAN to prevent false positives from assembly. + depends on !KMSAN select CRYPTO_BLKCIPHER select CRYPTO_GLUE_HELPER_X86 select CRYPTO_SIMD