Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp947446ybj; Tue, 5 May 2020 10:09:49 -0700 (PDT) X-Google-Smtp-Source: APiQypL24ELahJrFHKm+RcEuqtIU9qqirGjB5XrISDTcs8vbnP95amFmH3qPkb5C8ILh/3XS2A/O X-Received: by 2002:aa7:cf16:: with SMTP id a22mr3520626edy.77.1588698588996; Tue, 05 May 2020 10:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588698588; cv=none; d=google.com; s=arc-20160816; b=lIrYjPES6ZIH8Xrs/2EaiAu7zwt8swqqybqzkPohJJO6X9SsnYbHcphJDdM4eCr1Gc 9rA/xiy7venMjVmRxoKfkbvuauvkA2U2P+JlWeoZAHx0GNOiWWdyoUyQm3ZY3kubcp96 RSepznRJntwtJkjTs69zU7xTNeQWmzzLXZ7zUi/BJ5ENW4wM5PKAaXSgRAsMN0LwtHfg yhWgVj+e1LFAx0ypW6aA00/YyTpuLWZY+BZkVbjZKMr16wDb5WfJXehsElKVmsPbjxVI 6IOtZ2SXNzuZ1OLen3EoFElITgD72tROXaRHEGLe5t/biJRc/n4ZBZdZR1Pc0eDShkBb ppoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SwCBEJLwe7+6OV63AZ4GOUwDgwYhujIY1KxrxYevf8k=; b=gsfI7UqLCvWbqHlXaWfujjbZw9ut0mK8IScBspJcEYX9Oc3AMHAohGrAD2Ft9Flotv CKq/jpBAEh6Jh18B48EInglA6J2jTKzW4DYvbtioSi0jAE/TJmVXtkS32Vbt/PmmJX2z k7t+a9xjSTvh9bMVFtCkpmBuSUKuwJ2j6cdSw99oKEfVGqkp4zWDKjsq9M4I8pBHw1BK Nr962cwpvP1HMjGvjc5SxH5avR7shkRTwFuVYZg13TeIVBLIRudWk//UitAIAvAHvGrn Uh099Y84WA0cqpj1Y5hasQkNLkC+Ubw+m6brYuasxxhmou9JRvqpBNNY0GIh927fg6Rh ejeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AgMhYAYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si1542958edu.131.2020.05.05.10.09.24; Tue, 05 May 2020 10:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AgMhYAYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730736AbgEERHg (ORCPT + 99 others); Tue, 5 May 2020 13:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729209AbgEERHf (ORCPT ); Tue, 5 May 2020 13:07:35 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A9F8C061A0F for ; Tue, 5 May 2020 10:07:35 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id o24so2635001oic.0 for ; Tue, 05 May 2020 10:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SwCBEJLwe7+6OV63AZ4GOUwDgwYhujIY1KxrxYevf8k=; b=AgMhYAYI7oAoN+75kXJTQfJ9xq+4PvF/xfadMC/kGz0bHK0cWBykACmtXpL2yg133v IxetqIswOnRfoQeEkVvvafM74+y59R9S9mXPGam75gzOQSBbyOJNGzZ9fSYJmQSSM7dM ke4i6aZQm5a8vwCRRp1rBwG8Z4F/VM4idvH7Qps/TFZF7g+9FjQ4+h7okAyFlR9wx4jO n5uAIpknyy4Hj7hMpFIqxJo4Ti2klvjCXoD0t4T8UZniP7vwPVCp4IS7ScrK3PiMcDXs 4t4uRzxmPxZHwCkFnd3xg6egwy5pt07YK/j/7g8tEOijdeTuA1PR3NtmeEynQmd58Pf+ FxTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SwCBEJLwe7+6OV63AZ4GOUwDgwYhujIY1KxrxYevf8k=; b=Wr/MJ7+v0jPOprAtePv64MJaFTXiY7kn3g1Ja6ioeEW8gmcSkB7XqnfdE1JYK3WOlV Wt5MfZl0oIwR61SXAoaN7F5yoSFPjey3DADu4JgD+5GLVxcbkkXZ4HqXTHnc/GOPKPbt ihV9ghsahdHMtMM9hzAEXubsCHlfo2ff/eTrMXEIr3FfYYnXaHMkuaEk2MiHBGpss7hm txA3z2Xn5Rcmk1R/ZYtvfWHhDLfIQMAPvrn3uUtfdJU9p9jaoIpb49t+p6iwTo4r34j8 +kOeQ48wSCYxTY84cihd5GKYTg+0accAXk//LVEaaMZaDmFmoA15hRU6gwLg4FGL34SL Ygiw== X-Gm-Message-State: AGi0PualGFuyjz8Vn1N4e9LOPWcb6TKC20YMEapqbtJwKsNuzvFgDivq FoVuJr+qy2Pwf/Ol/5SrQDD5p5B1Exox8kK8ITCvtw== X-Received: by 2002:aca:c646:: with SMTP id w67mr3335582oif.70.1588698454453; Tue, 05 May 2020 10:07:34 -0700 (PDT) MIME-Version: 1.0 References: <20200505142341.1096942-1-arnd@arndb.de> In-Reply-To: From: Marco Elver Date: Tue, 5 May 2020 19:07:22 +0200 Message-ID: Subject: Re: [PATCH] ubsan, kcsan: don't combine sanitizer with kcov To: Arnd Bergmann Cc: Dmitry Vyukov , Andrey Ryabinin , Kees Cook , Andrey Konovalov , "Paul E. McKenney" , Ingo Molnar , Andrew Morton , Greg Kroah-Hartman , Stephen Rothwell , Thomas Gleixner , kasan-dev , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 May 2020 at 17:29, Arnd Bergmann wrote: > > On Tue, May 5, 2020 at 5:20 PM 'Marco Elver' via Clang Built Linux > wrote: > > > > --- a/lib/Kconfig.kcsan > > > +++ b/lib/Kconfig.kcsan > > > @@ -5,7 +5,7 @@ config HAVE_ARCH_KCSAN > > > > > > menuconfig KCSAN > > > bool "KCSAN: dynamic data race detector" > > > - depends on HAVE_ARCH_KCSAN && DEBUG_KERNEL && !KASAN && !KCOV > > > + depends on HAVE_ARCH_KCSAN && DEBUG_KERNEL && !KASAN && !(KCOV > > > && CC_IS_CLANG) > > > > I wonder if we can just add this: depends on !(KCOV && > > !$(cc-option,-Werror -fsanitize=thread -fsanitize-coverage=trace-pc)) > > > > Similarly for UBSAN. > > > > That way, once Clang supports this combination, we don't need another > > patch to fix it. > > Good idea. It probably get a little more complicated because kcov uses > different flags depending on other options: > > kcov-flags-$(CONFIG_CC_HAS_SANCOV_TRACE_PC) += -fsanitize-coverage=trace-pc > kcov-flags-$(CONFIG_KCOV_ENABLE_COMPARISONS) += -fsanitize-coverage=trace-cmp > kcov-flags-$(CONFIG_GCC_PLUGIN_SANCOV) += > -fplugin=$(objtree)/scripts/gcc-plugins/sancov_plugin.so > > Do you have any preference on whether we should make KCSAN or KCOV > conditional in this case? It may be easier to move the compiletime check > into CONFIG_KCOV_ENABLE_COMPARISONS and > CONFIG_CC_HAS_SANCOV_TRACE_PC. Whichever is easier. I think if we have a config that tries to set both, but then one gets silently disabled, it likely already breaks the usecase. It'd be nice if there was a way to warn about only one being selected so that a developer can then go back and choose the one they're most interested in (or change compiler). Thanks, -- Marco