From patchwork Mon Jul 10 18:35:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 118024 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp16168vqm; Mon, 10 Jul 2023 12:08:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlEgqEqrculH98MYXL3gGjkX057WDNAgqxMGQXidZ+8itFBjx858ND5iymsgem/WfevkUXFi X-Received: by 2002:a17:902:da89:b0:1b8:5541:9d5b with SMTP id j9-20020a170902da8900b001b855419d5bmr11555431plx.17.1689016080050; Mon, 10 Jul 2023 12:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689016080; cv=none; d=google.com; s=arc-20160816; b=jhlBoNyjNGSd5w/vraQvISOWNHAE8I7S4glH5zEqKYRasE53uGKzd39RzQff3E+TeJ Y4L7EXGn/Hsy8eTKZznVqGkLm+CjciRd+YuCdyW4D8MV9ZNlOpZ5kCc+/OvSJLvT+hnk UkFQXyBFFO2IpiHTI8fxfhyDBdzj6oQzCyE+C/NzK41tWmUtVDb8Gt3SZu6XkgTOAo87 rboBGJTRPXdXVTidcXgc2ZXHdkylL504qWhqzRoDt7MU7e9HkLs04eGP4/8FdaonBpGf EOOUqkamtm5cGDouV8Ys5m50oDQXnNAmIQeMjfLsOzrfq3J+HGR0u48htfbcErNADfKR Xt6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=aa5lQRof/F8cmDC3HRDbQ84WnKxCQ1duxxw+zC9cpn4=; fh=AMRkecuRLh1zvQ+O0EL0q1nlRykK6pdvrtWjx39dx7s=; b=yUYyMoOGFgYcG2P6Tx/7nC2s2AlKkppQdhtaCn8ixxzf24YhNpMTXDbacb1JEsdtPZ 1MffPNdkDoo9Ek73WLRK6k6mwBtYPM7zef0dHFT6pLjdZAM+4wwFECE5zr9JE3S3M8Jw Nbsx7mlVMQAtNi4Njg+QjA2QX5PIvEcu4tJsQVKI938aONYcSKR+hYfXNfiEteyDDf8i sWwWan8GT5bW/3ckFJgbun8rz4teF7DY/RDtmRzXibI9wd63lLf8VQ9ztD1v8E8+dMj7 ZCIFyMNpcdRb4cZf18/kqGfhd6YxdYJKh7O+HkAtBzspSeE+uNzfiamJqE0ilCgUleRk 2Y7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="23a/BYJO"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a17090274c600b001b8b2f69aa5si238580plt.294.2023.07.10.12.07.46; Mon, 10 Jul 2023 12:08:00 -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=@google.com header.s=20221208 header.b="23a/BYJO"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233330AbjGJSgP (ORCPT + 99 others); Mon, 10 Jul 2023 14:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233265AbjGJSgC (ORCPT ); Mon, 10 Jul 2023 14:36:02 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 623201AA for ; Mon, 10 Jul 2023 11:35:58 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-56942667393so59167137b3.2 for ; Mon, 10 Jul 2023 11:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689014157; x=1691606157; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=aa5lQRof/F8cmDC3HRDbQ84WnKxCQ1duxxw+zC9cpn4=; b=23a/BYJOg6q/fOh8fzxml3B4m2aOP1zFQvS2kQGJ08o95ldNeS0IPbiHDbR9gH9Fp6 kR6Sl8+BgYjzrFsG6yb+Rkk6MNGZW8hEsapNMPKNtCJKuk6nYjCRdQQ+uQb3B9UfB++f utBahDQJYg1o4JuRkSh968uQqvT98b9OmdJjbsrIk3o42Fk2d/ok29nfEUL7UUhqzHJv prPYLaV/c2enA8e2PLnR/POxy31CGGLrstg7H7frJDcw+SCozmYUGTbmwg1dBvxg2NPq 3w+buPLo/MfK/E/uNGpXJFH28p0Ada1smGQG/jSaDr/sxTRRhtnyAA/kKPGymQX7nGfJ 8FSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689014157; x=1691606157; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aa5lQRof/F8cmDC3HRDbQ84WnKxCQ1duxxw+zC9cpn4=; b=Um+XivWGUvCkIlS2e+sMFe/KLvl/SEE2Df1oDUSEqpZr7z0bDqCTl/PGsLXfQtm7FJ y1fCOIPzU2L6ZwUdmntficWywIfkft36mp3RCvyf1swmMgY15PuFml5OGnIA2SokCfCC GGK6KJnyWcmwnDYEXz+2dtil2gu2kO6Mo6CF9ibI0UaIrSG1+hd1QLZNTbcwimwjV550 niC1bqNiBO8AMRPXVj2oRBzVZLgFWfOV872qqr7mtqgC2IKRlip64RE+jf86HYWwjugq qhSrq31ZU/ISBE5uzTwDLij45GDnfHLkGyk4qrMFXuOSeOuYFcNUrNt5QmYiO7R0VWIp F5kw== X-Gm-Message-State: ABy/qLaVVlZhPEfkKcJRmuddTil/wHmm4/INPKHJPjUrVwUlOke8iCsa ynLGsAyoI2K8qxFQGkyZzrrWhXKD/hnLPQs1uLY= X-Received: from samitolvanen.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:4f92]) (user=samitolvanen job=sendgmr) by 2002:a81:b3c3:0:b0:569:e04a:239d with SMTP id r186-20020a81b3c3000000b00569e04a239dmr97416ywh.0.1689014157245; Mon, 10 Jul 2023 11:35:57 -0700 (PDT) Date: Mon, 10 Jul 2023 18:35:50 +0000 In-Reply-To: <20230710183544.999540-8-samitolvanen@google.com> Mime-Version: 1.0 References: <20230710183544.999540-8-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=820; i=samitolvanen@google.com; h=from:subject; bh=kymeq10zoWFqiY+GAwwmAwqNZBv1fmNg5qliMfkaSfY=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBkrE+BqQqqxzq7jHsOZNuj+FFSkh4kaftmf8PyY jDkFEmsHKSJAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCZKxPgQAKCRBMtfaEi7xW 7hR1DACL7wNpbhOW9RbbJ6wgRvYcoTTSZDHUgsClXupLaaeipyUO9QC9zsPf4Q1iemCy/NFGNyC JF7AS7FxhKhD5Cc5XVhwyColrHi1xcvd6H9jUoiE6UhKSdLbDa11uc/dH6nMQk1B7K8bUV8dq7y BTGqNZBzFvNBEXKspIzcxH+1qhZUKR5L+PcoVhaM1MPO22DQXRL7bBhknQ68Q4DNRNN/fEhIFd/ x1VO+WAhzdrmbt0UsBsYs8Iins8w4y3rr5takR5uFJjejP9YWDAusk8aDsuvoWfbYgMEh5xbCxa 1Fj/kfCx+v2CLL5VbmgP5kseMz5eTtbE1oxt4oMWlYHEMHcUwrS7+8W2qXt0k99dOtQnHVRZRuP 8luFpa8IutHZkKTVnPrLhUyCkK1TJjo4EjU8L589pXW39fW/up+mozwX985Km0FeB3Z220FUTGL zfFr01PoMwotR0AcrDE2aotdqMYL1mWrkB1IF3Umg3PtPxFoKaU+zURdOn13bxn/CxtbI= X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog Message-ID: <20230710183544.999540-13-samitolvanen@google.com> Subject: [PATCH v2 5/6] riscv/purgatory: Disable CFI From: Sami Tolvanen To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Kees Cook Cc: Nathan Chancellor , Nick Desaulniers , Conor Dooley , linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Sami Tolvanen X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771061725259621173 X-GMAIL-MSGID: 1771061725259621173 Filter out CC_FLAGS_CFI when CONFIG_CFI_CLANG. Reviewed-by: Kees Cook Tested-by: Nathan Chancellor Signed-off-by: Sami Tolvanen --- arch/riscv/purgatory/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/riscv/purgatory/Makefile b/arch/riscv/purgatory/Makefile index dc20e166983e..9e6476719abb 100644 --- a/arch/riscv/purgatory/Makefile +++ b/arch/riscv/purgatory/Makefile @@ -77,6 +77,10 @@ ifdef CONFIG_STACKPROTECTOR_STRONG PURGATORY_CFLAGS_REMOVE += -fstack-protector-strong endif +ifdef CONFIG_CFI_CLANG +PURGATORY_CFLAGS_REMOVE += $(CC_FLAGS_CFI) +endif + CFLAGS_REMOVE_purgatory.o += $(PURGATORY_CFLAGS_REMOVE) CFLAGS_purgatory.o += $(PURGATORY_CFLAGS)