Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5317190rwe; Tue, 18 Apr 2023 05:25:26 -0700 (PDT) X-Google-Smtp-Source: AKy350aQPwL6aEOVcZ2ku3d73mIu0PoxHfKqgZdoAsoa35yYqfzJkcmpcdNbq8KYqxp81S95wyPr X-Received: by 2002:a05:6a20:2007:b0:d6:7264:f44e with SMTP id w7-20020a056a20200700b000d67264f44emr16661445pzw.3.1681820726680; Tue, 18 Apr 2023 05:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681820726; cv=none; d=google.com; s=arc-20160816; b=z1d27ue/ek/SXCkcJKfrILGLBz39wCIbMMIER7V0WWWahfD9jDUwR90Kqrldg42pcN oD/SH+TFYUgKpTm2fHSaw7jvjaVzOkz8TSU9Rs+JKwreQq0y6V+nKCV1T7DDvW3tBPSS m1D4spKBokTELv3m6WPgmGA1ptLhSaTeNw+HJdCDTahqXCf8xj2leSHLUQt8C3Eyrv1n CUhM1CC5c0hMDfN6DorHozgxWmT7XDM9M+n33W1Dip9WODs+H1HoRMWjGqpPgqyq45uy oFE7GOOyY1GS+hkf4BAWqNg8B/JuCfHghOtO4OtkjRdkI55pweC+m8ZMOiXRybaeySxF 1W/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rCHsboCrzW2SygIqg56Vq9y+2W0XVFNSXAStqyqIoOo=; b=DWzgUYw7ipKSbFt0RFiDVaqRVXBATHBnUDIPq0b7mnI1bF436rXFpiQYGXJu7FQzT7 cmFUkxf5je0ExwbDO7EGgpwJLXvcZ4lfLqnG5JOpKTG0IbXbsWTBNbbYf77ThkQ+jRid 66D/dgkNv1pBQU4oEXLTfgTWC84dvk7p8nYhKpD1i9yB7SJSDhFSMtPIFQlGyOr/jEtm mxmqR5jMFlMtafc2h6HoKXIASSBeZj77fvV9vbCfOMzl5rOqaxxlbPK2Xk6aX2SLAyd4 x7VoyMj9GyGCOHC7Xvh8jKDCpNGjBp7wBRaTi7jWByo1Hf+IfzW7bVJFhWO7+2UqvbrU 8x+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZV5ApDRA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l186-20020a6388c3000000b0051b6c0d78a8si11956806pgd.616.2023.04.18.05.25.12; Tue, 18 Apr 2023 05:25:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZV5ApDRA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbjDRMYD (ORCPT + 99 others); Tue, 18 Apr 2023 08:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbjDRMYC (ORCPT ); Tue, 18 Apr 2023 08:24:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2D5E4C28; Tue, 18 Apr 2023 05:23:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4125A630F2; Tue, 18 Apr 2023 12:23:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA6D4C4339B; Tue, 18 Apr 2023 12:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681820637; bh=Pl7qe1hAnrP+LtVJ6K+2U2pcxRX/WcQvra5GGhz/u6E=; h=From:To:Cc:Subject:Date:From; b=ZV5ApDRAANpiHhaO421exFkJL+f9/cyKqYJDClXnFpP78N6NHpc5acuTMCnwrO5U+ yCTXwgMlGU294bLFzBnsTvW3IrY/19mThftD5ndrMlJF6WfhoILio9vlCt7Xtl3H3n yxin7yexwPHB8ClnOsuilIDEhl6Knw7pBX6Lxn3YKFksCb7LiI2zNV2oKJ3p7kXrzh dwCdXOKtbHDSI+YXtuQ2bxjqFmFODE550Wu4Imp9G7LCmBAXbmV4kExNEd5urcqEpn Tl3FCJUTPuqIFgPZhQWwitBhAmTa3+jTd6FZ3UCq5z8j/nO74a7RlVmBXr0WmgKjhn khRNdTpQgffaQ== From: Arnd Bergmann To: Masahiro Yamada , Marco Elver Cc: Arnd Bergmann , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Tom Rix , Andrew Morton , "Peter Zijlstra (Intel)" , Michael Ellerman , kasan-dev@googlegroups.com, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] [v2] kasan: remove hwasan-kernel-mem-intrinsic-prefix=1 for clang-14 Date: Tue, 18 Apr 2023 14:23:35 +0200 Message-Id: <20230418122350.1646391-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Some unknown -mllvm options (i.e. those starting with the letter "h") don't cause an error to be returned by clang, so the cc-option helper adds the unknown hwasan-kernel-mem-intrinsic-prefix=1 flag to CFLAGS with compilers that are new enough for hwasan but too old for this option. This causes a rather unreadable build failure: fixdep: error opening file: scripts/mod/.empty.o.d: No such file or directory make[4]: *** [/home/arnd/arm-soc/scripts/Makefile.build:252: scripts/mod/empty.o] Error 2 fixdep: error opening file: scripts/mod/.devicetable-offsets.s.d: No such file or directory make[4]: *** [/home/arnd/arm-soc/scripts/Makefile.build:114: scripts/mod/devicetable-offsets.s] Error 2 Add a version check to only allow this option with clang-15, gcc-13 or later versions. Fixes: 51287dcb00cc ("kasan: emit different calls for instrumentable memintrinsics") Link: https://lore.kernel.org/all/CANpmjNMwYosrvqh4ogDO8rgn+SeDHM2b-shD21wTypm_6MMe=g@mail.gmail.com/ Signed-off-by: Arnd Bergmann --- v2: use one-line version check for both clang and gcc, clarify changelog text --- scripts/Makefile.kasan | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index c186110ffa20..390658a2d5b7 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -69,7 +69,9 @@ CFLAGS_KASAN := -fsanitize=kernel-hwaddress \ $(instrumentation_flags) # Instrument memcpy/memset/memmove calls by using instrumented __hwasan_mem*(). +ifeq ($(call clang-min-version, 150000)$(call gcc-min-version, 130000),y) CFLAGS_KASAN += $(call cc-param,hwasan-kernel-mem-intrinsic-prefix=1) +endif endif # CONFIG_KASAN_SW_TAGS -- 2.39.2