From patchwork Fri Jun 10 23:35:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 12878205 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 84498C43334 for ; Fri, 10 Jun 2022 23:40:50 +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=IEDRwh+xC80s2mc/jNVDS6L1AjkDq1MFr9CNZzZtQ+g=; b=z62RDdt3kMA4unPxR2yKr6m1BN h1BvVCZ6AXTzpFWRveLdLahJtP3KfNOlIiDX1ku5Ui6PYHzMhwsRtKtHMfZBGFPdAqrMLxj6EVZo3 8pbZB9qM12SQwSthIjQbst7MY0BD3uf2idPkUm5jC6PhhQrJHDmnAzpNN2c8cUEsbVWK2hS9yy+iF AZkU6RM9ST9GMAqc1L0Xi77EcfjkTu/xvS5gXFFo1HjcRa8Ck98dikCqdGStdL5jGpEEfDPeZ2EtC JLUNT7Vs5byCXvwKDw5VMIJrfWsf314RCFFW8TeGt1df0QcYx3KH9JGSxueZndE5veJ4/2nrboUCe It+1M9oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzoE7-00ASzf-1q; Fri, 10 Jun 2022 23:39:41 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzoAd-00AR7y-9B for linux-arm-kernel@lists.infradead.org; Fri, 10 Jun 2022 23:36:04 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id l3-20020a257003000000b00663dca68ed8so573267ybc.4 for ; Fri, 10 Jun 2022 16:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=NebnbUevd7O3L4DZUnHH2cfPN5CPKXFBfrXdmTOrusA=; b=KKJz0ETKMeSBcMXnJZjZzeLcSxRSw/g6ohEJqB/0rJWBgf4O7ADHPH5kU9Xluuy/XT 3SlAe7Z2V+5bh51W0KcedotGu/qgjThHz6ojq/xqG3z9PbC4K4Xz+xgc6hTpQzNLaKgi Xbsix6EkV+RvNC/YiWwda98NnsfGpQ4h7sS9l+4FoYRnJks6OhV2lU3T8FOmsDsgUBBT 3Y06pvNAxA2Sooe8D9naqKp7IjcYWnBD27Ep2iihcbGhxM2a9yPNv/UsuM19hWUqiHxo crcwgtBlgH40phoQX67UjusAcKfvxfyDl2nXhnMBPgQWXrpXgZb+17RxEgaNl/ZxRXul UJFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=NebnbUevd7O3L4DZUnHH2cfPN5CPKXFBfrXdmTOrusA=; b=2waDxqKufOCyc/6LfUevwJFg/WE6SzgQt+i0PeFjW3Y/00/u0q1P4Iyz4wfyo3LbOu E0HOsjXbTlAAkyYD/NEWGisAo0u1rvNxomQKCcAotmCNdXtYdbp4MKLa00JMzUOSp6C4 chRiZJ65DqK7o5wQollyMsGf3d9rGlhGR9g0/FX5yNwoJTwIAxW8mkK6jtY/SPwJKC+k /sLZ5nlPYUTIdOBIzD6tS5dMsA4039Do7+zsMb6nVazNZtgKZ+kN3QOpp/i2NC0ewBfl Xt0QR1NZcrDjF0kLvh5nnLsJpory/CwtjpRoa37HbZHCqOkz9zfdgJQp3me3q+nn2qi1 Q5OA== X-Gm-Message-State: AOAM533QEYUN5Ew+ncyZQovNRnsnVDBVCC1ljzBp7MpJgEPXDA4KVYWr kijHdREr8k+TUxIiornZDtpY5BQkvlmlzmaHT9g= X-Google-Smtp-Source: ABdhPJy73NkoCpX2nYrYNZCDIlzOJNtXCf9DaSoyKSy9IAHEUYo9ySkQOZFLTvi0faxx0KI52nrC8nXKkuoc7+egsDw= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:f464:6db6:3d47:ed14]) (user=samitolvanen job=sendgmr) by 2002:a05:6902:905:b0:64a:2089:f487 with SMTP id bu5-20020a056902090500b0064a2089f487mr47802874ybb.202.1654904161997; Fri, 10 Jun 2022 16:36:01 -0700 (PDT) Date: Fri, 10 Jun 2022 16:35:12 -0700 In-Reply-To: <20220610233513.1798771-1-samitolvanen@google.com> Message-Id: <20220610233513.1798771-20-samitolvanen@google.com> Mime-Version: 1.0 References: <20220610233513.1798771-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; h=from:subject; bh=ArPYWKwU35vK9Q7fuJlo1ALDBI9fX95H0CE4usoZ/3Q=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBio9UvnQCq/98P6oNAklKJC8WEg93jIEEZ3s64nlfE jwrc2t2JAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCYqPVLwAKCRBMtfaEi7xW7vmmC/ 9Qrdc+4b2GDVRqmqvGAW33iyBJiMYbCO4QDRAxsqvRUhT5K1vwyy6qVCAUsRMiltfbmxmPfrsqZJ4N hVmPqbb/xFmJ4/2VWkeHN4jV/0Ms9EUsFTVsPjSguMqImRg0ydJ4IIkrzddZZATwLAd87WWt5x6woP CtHUksEZGn7o4Pp5ct3NUz83Hb6LHo2m9mjOGPg1r33oforu2vx/OfVCEjx73Xcxo6RDIH3UsDuD/g /s3THqOg4srXhMfFGuDwEKmrtvLlhmpsNQIsAHYQMsq+8GlhciaZg121OkGkS4sL/rnpTey/W3To3I duP0DhDBHWFptNY8nhoygvOPOT7N9DVYfAJ0SrSvoOo2h7FmdAi5XhhyvjVZvys4tcp6shnIG175cb 0lmK0RZFZpwqCNOr1PORsFlHiTeRUcKrve4AplmbR9zGkRHED1lI0LtXSbIIcWu+5IP8ooqVNxOVYr sCtJLXG/F9yAngLbw5kbgWwO7iZTHLWHbfFTd8TAmbaqg= X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog Subject: [RFC PATCH v3 19/20] 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-20220610_163603_375924_067A2CA5 X-CRM114-Status: UNSURE ( 9.45 ) 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 ae53d54d7959..b3fa947fa38b 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)