Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3013460pxb; Mon, 4 Apr 2022 05:48:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2KjMoGAyjUuhZQ8WEwwdRLueiXtDVbwF1ozFrtB/4GAENq62hM906wYaHNHd1eumhuHA8 X-Received: by 2002:a17:907:72c5:b0:6d6:e749:da41 with SMTP id du5-20020a17090772c500b006d6e749da41mr11225141ejc.591.1649076515696; Mon, 04 Apr 2022 05:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649076515; cv=none; d=google.com; s=arc-20160816; b=TUGFJ7DJpU94YfYdWKpRv52rWxjHQfJpHacNlb4ssjx1fav257beQOgT30bas6znCP P5MNbu+nIq0lUY3Lcx4i+i+DAltT4XVOoxf3Ax0iyYa+WeNr8ZqPER8LRnzoX0A9m/RM 0e5kofPpXOYkoH/GdK4nibBAmYyJm/LF617wQagZH5tKhFu65Z849zLy2FV5vda/2QAI pNUOFo7HZoJCBTGVDVRKNnsXm0D3uUz5kqgEWoX+6Y5xDsJLVqa3TyOqItqOvt6sEmGp ZyVhJg2mpWRvFAcjOeC2d480q5ShH0zdNqQWR1ehARSKa+1BvZN80YimLh8rZaTZeVnl jmiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:dkim-filter; bh=xOOUq32hUTZwQ6PgJmve8CWFa41o5uzRkpcTqar04RU=; b=YO7AqXFjriKpubHpUDEx3ppnBfKIAr798GYiPiLhFW2NO9dq2lcaBNhvRxz/BSqOHT 0wji5TfzMZcG8B/Dt35DGLkvFBjsXnJblGCoAwC+0+V9U+OQS7/ZJ27BzVCK4GqLYWwB KCjW+VgNBwGCumYC20rNftxo7yVT55Bpb1OIq+OhowbwIGcHQNsPB5VJKb3TnKX4Qsh9 EpNe48+TmDFKrPX9rTYgalClbt6naThF2yfOX96iqCFLCZLothgLI9Bh0V437AG/wXB1 OuU9hwT1gxqVr01F5MUerSXFHfPprDbbEhqYtCUX+oJ5OjZ+4r9mn5g8yLeHvVU7DEE/ Fkpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=vCXu70nR; 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 l7-20020a17090615c700b006df76385ca2si6077432ejd.322.2022.04.04.05.48.08; Mon, 04 Apr 2022 05:48:35 -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=@nifty.com header.s=dec2015msa header.b=vCXu70nR; 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 S238702AbiDBNeM (ORCPT + 99 others); Sat, 2 Apr 2022 09:34:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbiDBNeK (ORCPT ); Sat, 2 Apr 2022 09:34:10 -0400 Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C527100E24 for ; Sat, 2 Apr 2022 06:32:18 -0700 (PDT) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 232DVpoE026970 for ; Sat, 2 Apr 2022 22:31:52 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 232DVpoE026970 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1648906312; bh=xOOUq32hUTZwQ6PgJmve8CWFa41o5uzRkpcTqar04RU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vCXu70nRSHY2Lv6Bw5iUYKQi4NgIBNGXSOv3tNAM7uIraCCo4LTa/ywLh+ye+shXb nyeay6O+48FKit5/DNX5BWey6iI40BfoR2CRvJ9EJ5+1MXt/oOmH7AiGeFkXQ0CPLj overa1Km8ueTLcpp80BLIQS5+ythR9TwB7nORO0unED0bJyMNbIeDnSvXjmiPGLNNy rtWiVaxJCRfc+6O8PQvVYCjXyi9cVfCo2OyOiU1mPuDeADIf6nNevP14XZ80czHeJc j3n6MCL+YEvGPHblicFd6wB/EgXap3UVRfAnQwGa7ymZI7mzsiAUubppy7IoR+dbuJ oanKvBFDQVSfg== X-Nifty-SrcIP: [209.85.210.175] Received: by mail-pf1-f175.google.com with SMTP id f3so4990636pfe.2 for ; Sat, 02 Apr 2022 06:31:51 -0700 (PDT) X-Gm-Message-State: AOAM530zon4+2wc6e300ATrmBfUIDxkOiz8xt4ZVCWK6XEDYQPXImffd tYmXXEBiIg+KqaxaqrgxX6f/xh0RV4Lhi5Plsso= X-Received: by 2002:a63:ec47:0:b0:382:692a:dc04 with SMTP id r7-20020a63ec47000000b00382692adc04mr18906915pgj.352.1648906311008; Sat, 02 Apr 2022 06:31:51 -0700 (PDT) MIME-Version: 1.0 References: <20220401201916.1487500-1-samitolvanen@google.com> <20220401201916.1487500-2-samitolvanen@google.com> In-Reply-To: <20220401201916.1487500-2-samitolvanen@google.com> From: Masahiro Yamada Date: Sat, 2 Apr 2022 22:31:03 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/3] kbuild: Change CFI_CLANG to depend on __builtin_function_start To: Sami Tolvanen Cc: Kees Cook , Catalin Marinas , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Will Deacon , linux-arm-kernel , Linux Kernel Mailing List , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL, T_SCC_BODY_TEXT_LINE autolearn=no 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 On Sat, Apr 2, 2022 at 5:19 AM Sami Tolvanen wrot= e: > > Clang 14 added support for the __builtin_function_start() > built-in function, which allows us to implement function_nocfi() > without architecture-specific inline assembly. This patch changes > CONFIG_CFI_CLANG to depend on the built-in and effectively upgrades > the minimum supported compiler version for CFI to Clang 14. From this description, I think the straight-forward change would be: depends on CLANG_VERSION >=3D 120000 --> depends on CLANG_VERSION >=3D 140000 Any reason to avoid this? > > Signed-off-by: Sami Tolvanen > --- > arch/Kconfig | 5 +---- > init/Kconfig | 3 +++ > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/Kconfig b/arch/Kconfig > index 29b0167c088b..eecfc2809781 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -723,10 +723,7 @@ config ARCH_SUPPORTS_CFI_CLANG > config CFI_CLANG > bool "Use Clang's Control Flow Integrity (CFI)" > depends on LTO_CLANG && ARCH_SUPPORTS_CFI_CLANG > - # Clang >=3D 12: > - # - https://bugs.llvm.org/show_bug.cgi?id=3D46258 > - # - https://bugs.llvm.org/show_bug.cgi?id=3D47479 > - depends on CLANG_VERSION >=3D 120000 > + depends on CC_HAS_BUILTIN_FUNCTION_START > select KALLSYMS > help > This option enables Clang=E2=80=99s forward-edge Control Flow I= ntegrity > diff --git a/init/Kconfig b/init/Kconfig > index ddcbefe535e9..f024fd353373 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -86,6 +86,9 @@ config CC_HAS_ASM_INLINE > config CC_HAS_NO_PROFILE_FN_ATTR > def_bool $(success,echo '__attribute__((no_profile_instrument_fun= ction)) int x();' | $(CC) -x c - -c -o /dev/null -Werror) > > +config CC_HAS_BUILTIN_FUNCTION_START > + def_bool $(success,echo 'void f(void) {}; void *p =3D __builtin_f= unction_start(f);' | $(CC) -x c - -c -o /dev/null) > + > config PAHOLE_VERSION > int > default $(shell,$(srctree)/scripts/pahole-version.sh $(PAHOLE)) > -- > 2.35.0 > -- Best Regards Masahiro Yamada