From patchwork Tue Aug 30 23:31:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 12960162 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C04FAECAAD5 for ; Wed, 31 Aug 2022 00:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=WV8wwekA57Rxhdsk2z2muPkDCeSnoLWoRpm17oGTozU=; b=Ah+9gDjrZsjFU/amJ3LjwYaIYM lyhpoLudm1MsZdZUQxL4g4cn/Aa5BxQt1JCHEKU4iTqSB/u1xtTQ+Fvp9G2/PlHqPStD5Sga/hfNG SG98A8vNTzWGIaDYRzgZzSwJORUpoWZNx0HWfA3cndi0CvWqr1M1Mi2BMZigFW/xb0KFHXgAdqWhC pEd/+vqq37Q8aYmlje9++xTiyMzAqps8Bjqby6kB1xeeXTjTqyOv4cLrII8iR5Has3ovBnwpYJM4u dN0KTBv27dJ1cXqV3hHlk1QZpRovyQjieagpePmudXCppZmbVgP9iYEBYJn5f6JWBLfdR2MtOg5ar HfcnQa5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTBCX-002biA-VP; Wed, 31 Aug 2022 00:03:26 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTBCN-002bel-US for linux-arm-kernel@bombadil.infradead.org; Wed, 31 Aug 2022 00:03:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Cc:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JGJThSQrG14h993s8rjwM8jNb3CuBSnZl7zjhnevu+g=; b=CnV3lkBTUfdjHQsmtR26ds0aqE eXELVkutrroRvl/Ae2uup5u/37ZGMAJB9LVbSL06+aVxyINdb2VGovzFUCCnL3Xkzj6fi8STRdCES UpILhCAzV85PNDqNalZiRkMkhpE0Gl/t3sJ6qy4biz+2zn1hZQ3sbG2LnAteLuA0WlmPpVsm5+j+X cBO2l/veyRJmIklXqfbaHELsb5LpmvaL0d0pUVjwT8DflYwbjPlmPzIPAlnUCysYqZSPpsiGDIhFs sqtWxs4jD6irmzym5FZ1wnPt5PtktGVQzeIpvCLThjoQ8XNH+IPa2u5MPnPry8fkq8kOyX+oKXsOS ZxGgRYkQ==; Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTAib-007zlY-Qe for linux-arm-kernel@lists.infradead.org; Tue, 30 Aug 2022 23:32:31 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-340ae84fb7dso158362887b3.17 for ; Tue, 30 Aug 2022 16:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date; bh=JGJThSQrG14h993s8rjwM8jNb3CuBSnZl7zjhnevu+g=; b=DOh9amPi8sdlIOf+BiQAcIL4C8dBW/B9BWrb3DDZwGjZRuBGPkwG8kg8wpUGEynqN4 HbwlJ211/vN250153b8eTEEz+hJGiHPIdyx8Zz5WSB/eRxv4x+R8c6xaiPurZnqHBUe3 7eUibXAR1rL0QJGQFURQEgHMRLr+JSZOLcNBOIXbJOXcNuGf4he8R/RcghJuPZwG87Gp L+pDTBkMbM7mIefPA4Unu/iXF4eeVd9tDHBc5q6aRSwecfYH2copC/6dCggsaXuVuvUw fzuv78FCYDYsach0a90W8IsCcCNCzrOKyw5GIQzwfi8hwWvxOfgq6EoJfTjPWYbOy/X8 OGkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=JGJThSQrG14h993s8rjwM8jNb3CuBSnZl7zjhnevu+g=; b=ZC3bJGswYExykiE7MbISiLPHPWKcfJf/CA3KCy7iF4Y9IdU4HFu9OrenIySQ4mVie7 mKrRZiVU/tdtARJbWRcgxkpA4JksmG+sxAEenSz7Du/EiJsc+eF/AV8cgCeJz33AGYY7 y2DdNUxreRFPAxaV7RqqQe0TfDW+6kJxxSYW3eSDKtFs7X905Iy5twrM0wBBQIlqmgol OvBfXbmyo0b6/lSOBYtVmJamGNYCtwyn95QtL0/ltGRUYASbgsDOThVBAFMidz4+wb9x pGtzDtwZrNT2pKhUsoKdBe6hbdD7Xd1QcRUkH9yzThgCuDXWwH2ulyo6kpBKTqPuFJ+R P4/Q== X-Gm-Message-State: ACgBeo0mGzqRxaSLhTqJK8PpSRvSqqhU6Vs1IRNnvIEFHeQjVXMXm4bO W80PGUDlwqFesusm0eB4ulMn8+puNWvGYm6E/6s= X-Google-Smtp-Source: AA6agR4PyO0IKBEZVO/AvffiR0akECN3URvghZTslxK3C371SGy+urp8y7XT0ytOb7JDjFdBCeYbfFF5vHW2XgdhiqQ= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:54d9:7143:6a7d:91d]) (user=samitolvanen job=sendgmr) by 2002:a81:d34a:0:b0:31f:4467:4ae0 with SMTP id d10-20020a81d34a000000b0031f44674ae0mr15725365ywl.477.1661902348134; Tue, 30 Aug 2022 16:32:28 -0700 (PDT) Date: Tue, 30 Aug 2022 16:31:28 -0700 In-Reply-To: <20220830233129.30610-1-samitolvanen@google.com> Message-Id: <20220830233129.30610-21-samitolvanen@google.com> Mime-Version: 1.0 References: <20220830233129.30610-1-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=915; i=samitolvanen@google.com; h=from:subject; bh=m63Aw2OCZubNDlnS2Bm9+IxQqtHz35eVVBHmUgLi/wI=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBjDp3PBebzwTJ+52Sw6ogCU/KIG0JsWDvzXb2RlSP7 p3Tx7bKJAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCYw6dzwAKCRBMtfaEi7xW7gtjC/ 46Gj3n4xq2s5nOkzOlhRg6U2y6bfUnt9ieyOLUS5LwZTt+4P1YtZ1bAy7fXQjlY5N5Jru8Wxiou2NQ XkZHG3/eLGFq67shCldfkkdKJuw3zTrocl0l0U3bI95JISYisD70CC/v6rHsGqKjP/uSRXNRP30aAm 8suLZ5bim00kqnPRf6F4sy1mk6/W6hXGgUi6oz2niBNwvb3cYpY3LEd4WZl8pIbELZtdYdrW7jGWrG jGzA1gDMc6M1m0iQyrWFLfMS8Z/Ox52XdhaR+isbHp7AtJxqO0qbN9Fh/L6E3lJiJiGcQgwAhgGfYw OElKjGI/zYiSnKS1XqBhHYQ44Sy0ZrW3vzzzSSERj0TNDSVk87P9KWRlJ2zsEDrD4S3t8So/m9NEcP 4nl6pCyebjHvO7PMvnuJ5Ds/WxR8rqm5SuxbPGbmdyvl6F+LZ7o+EKzgevJrNFIW3c7+8RRcbkr+OL PaYZxJCu03C4/PK10hnG4Dww9r1ervjssX1vNaeEtQoUw= X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Subject: [PATCH v4 20/21] x86/purgatory: Disable CFI From: Sami Tolvanen To: linux-kernel@vger.kernel.org Cc: Kees Cook , Josh Poimboeuf , Peter Zijlstra , x86@kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, Sami Tolvanen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220831_003230_006417_E827648B X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Disable CONFIG_CFI_CLANG for the stand-alone purgatory.ro. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Tested-by: Nick Desaulniers Tested-by: Sedat Dilek --- arch/x86/purgatory/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile index 31c634a22818..58a200dc762d 100644 --- a/arch/x86/purgatory/Makefile +++ b/arch/x86/purgatory/Makefile @@ -55,6 +55,10 @@ ifdef CONFIG_RETPOLINE PURGATORY_CFLAGS_REMOVE += $(RETPOLINE_CFLAGS) endif +ifdef CONFIG_CFI_CLANG +PURGATORY_CFLAGS_REMOVE += $(CC_FLAGS_CFI) +endif + CFLAGS_REMOVE_purgatory.o += $(PURGATORY_CFLAGS_REMOVE) CFLAGS_purgatory.o += $(PURGATORY_CFLAGS)