From patchwork Fri Jan 28 10:56:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Elver X-Patchwork-Id: 12728206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82011C433EF for ; Fri, 28 Jan 2022 10:56:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3BC86B0071; Fri, 28 Jan 2022 05:56:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EC5246B0072; Fri, 28 Jan 2022 05:56:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D64E56B0073; Fri, 28 Jan 2022 05:56:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id C20486B0071 for ; Fri, 28 Jan 2022 05:56:49 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 82E4484A37 for ; Fri, 28 Jan 2022 10:56:49 +0000 (UTC) X-FDA: 79079392938.24.122F41E Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by imf18.hostedemail.com (Postfix) with ESMTP id 13C451C0023 for ; Fri, 28 Jan 2022 10:56:48 +0000 (UTC) Received: by mail-wr1-f73.google.com with SMTP id i16-20020adfa510000000b001d7f57750a6so2135423wrb.0 for ; Fri, 28 Jan 2022 02:56:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=hOuzpWzwLqePrG7KzMy6POmcapEVAbM5YRYunKpotWo=; b=fhKHd24To3BSoahiJrP4xlDXKpCv3i4ceobI3bbA37VyEE3jRp+O4mYy3/TpA/jZUB 78s9JcvafHZk3Nv+QJ6aCkxV9DZmzWwQgza39CikAKbFpAJH0gRfvxzJxrMR/iUme2H3 jBo52tynN+ZI9p0SCpL3h18OjUIbSbtNRMJGh80vv2vTRQiN+lFaGOP/UvUEWZe+EzBd qo4vUcf5tsb7t+H7W+pSujNUVMXKA/ziuTBUv4540NXCHFMarAxcrf7im8cjNoxjH+Eq XhJqmEV3hYNuBw30oMLQ+eJLGDpd3lfJyo0cx764C6KNLR1EY9entQi/H9+gyre8f59f GQKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=hOuzpWzwLqePrG7KzMy6POmcapEVAbM5YRYunKpotWo=; b=BTmDT26+P3TGdZv10L3jMvnOfTEafqpBowFDNClm8UkTqfLslft3BwfqrrK46mpm/b J6U65Udv/1RjBrkSTpKWtPgQJN4fxeKCNLBsIQs7eogm91UU5FelGSV901EFoSWJWz1g ikTZJ5GYUVJIj/f4RPqYzcG60de4Y2xC5DmPwFEUzoT2CdTLsKU6V9QURP7FLOZ5OnG+ BxbzdgNk/HMnWOGVanFEELmMptjnd5PxVe2wbTrv2bmbxvtCoyAi/ZKiuYJasajjaKFv dwR84HiG8Tu2o228NxLMZXrn0/Q+UTl3VO4YbNHIj8Xmfdsks5Reu5qOgvw2JTuqmTt6 PT6A== X-Gm-Message-State: AOAM5311UNDeisXwIRXxxbR+dtl5zDuhCoC/XKA67reOU/04mfUysvGn Xf+9MoME4EGjsYYLtkUIa/HATERe6Q== X-Google-Smtp-Source: ABdhPJzZhi7RO2wuFmy6tcbCdw7/usEDleeyJpfpVLQrgRK/raZHfrPpldl5/HboAaShtwFxDIU0Zk2/tQ== X-Received: from elver.muc.corp.google.com ([2a00:79e0:15:13:f088:5245:7f91:d730]) (user=elver job=sendgmr) by 2002:a1c:a544:: with SMTP id o65mr15295285wme.160.1643367407413; Fri, 28 Jan 2022 02:56:47 -0800 (PST) Date: Fri, 28 Jan 2022 11:56:31 +0100 Message-Id: <20220128105631.509772-1-elver@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog Subject: [PATCH] Revert "ubsan, kcsan: Don't combine sanitizer with kcov on clang" From: Marco Elver To: elver@google.com, Andrew Morton Cc: Alexander Potapenko , Dmitry Vyukov , Nathan Chancellor , Nick Desaulniers , Kees Cook , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-mm@kvack.org, Arnd Bergmann , linux-kbuild@vger.kernel.org Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fhKHd24T; spf=pass (imf18.hostedemail.com: domain of 378vzYQUKCGwOVfObQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--elver.bounces.google.com designates 209.85.221.73 as permitted sender) smtp.mailfrom=378vzYQUKCGwOVfObQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--elver.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: nil X-Rspamd-Queue-Id: 13C451C0023 X-Stat-Signature: 1pgn7xrzkum8fzxj6tqz5ue1f4cmtb59 X-Rspamd-Server: rspam12 X-HE-Tag: 1643367408-611362 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000069, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This reverts commit ea91a1d45d19469001a4955583187b0d75915759. Since df05c0e9496c ("Documentation: Raise the minimum supported version of LLVM to 11.0.0") the minimum Clang version is now 11.0, which fixed the UBSAN/KCSAN vs. KCOV incompatibilities. Link: https://bugs.llvm.org/show_bug.cgi?id=45831 Link: https://lkml.kernel.org/r/YaodyZzu0MTCJcvO@elver.google.com Signed-off-by: Marco Elver Reviewed-by: Nathan Chancellor Reviewed-by: Kees Cook --- lib/Kconfig.kcsan | 11 ----------- lib/Kconfig.ubsan | 12 ------------ 2 files changed, 23 deletions(-) diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan index 63b70b8c5551..de022445fbba 100644 --- a/lib/Kconfig.kcsan +++ b/lib/Kconfig.kcsan @@ -10,21 +10,10 @@ config HAVE_KCSAN_COMPILER For the list of compilers that support KCSAN, please see . -config KCSAN_KCOV_BROKEN - def_bool KCOV && CC_HAS_SANCOV_TRACE_PC - depends on CC_IS_CLANG - depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=thread -fsanitize-coverage=trace-pc) - help - Some versions of clang support either KCSAN and KCOV but not the - combination of the two. - See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status - in newer releases. - menuconfig KCSAN bool "KCSAN: dynamic data race detector" depends on HAVE_ARCH_KCSAN && HAVE_KCSAN_COMPILER depends on DEBUG_KERNEL && !KASAN - depends on !KCSAN_KCOV_BROKEN select STACKTRACE help The Kernel Concurrency Sanitizer (KCSAN) is a dynamic diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan index 236c5cefc4cc..f3c57ed51838 100644 --- a/lib/Kconfig.ubsan +++ b/lib/Kconfig.ubsan @@ -27,16 +27,6 @@ config UBSAN_TRAP the system. For some system builders this is an acceptable trade-off. -config UBSAN_KCOV_BROKEN - def_bool KCOV && CC_HAS_SANCOV_TRACE_PC - depends on CC_IS_CLANG - depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=bounds -fsanitize-coverage=trace-pc) - help - Some versions of clang support either UBSAN or KCOV but not the - combination of the two. - See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status - in newer releases. - config CC_HAS_UBSAN_BOUNDS def_bool $(cc-option,-fsanitize=bounds) @@ -46,7 +36,6 @@ config CC_HAS_UBSAN_ARRAY_BOUNDS config UBSAN_BOUNDS bool "Perform array index bounds checking" default UBSAN - depends on !UBSAN_KCOV_BROKEN depends on CC_HAS_UBSAN_ARRAY_BOUNDS || CC_HAS_UBSAN_BOUNDS help This option enables detection of directly indexed out of bounds @@ -72,7 +61,6 @@ config UBSAN_ARRAY_BOUNDS config UBSAN_LOCAL_BOUNDS bool "Perform array local bounds checking" depends on UBSAN_TRAP - depends on !UBSAN_KCOV_BROKEN depends on $(cc-option,-fsanitize=local-bounds) help This option enables -fsanitize=local-bounds which traps when an