From mboxrd@z Thu Jan 1 00:00:00 1970 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 7AE19C433EF for ; Wed, 15 Jun 2022 17:13:33 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bWpoilB9K9b+7ny6giYD9mIFPxN6gQqHe2gF2LkAB3E=; b=cD0VCeIVu7U2F0 F6eRX/AdrkW6ze4u7yUOuIQEjktMI00UlScDVwgqzyjKnvgZx1XBLRuno0jmfvX7NzUzDZbhHtP6X UP9P5Xs+KKgIilkpheAr83SxLilyLSJekqubkjXlbT4/ap4aYDyvMWI7NXfzmMQJmwR/Nsoz6/ZaN M7Mys+YF94rvmYODHhtpt9xv0wYQqlO85qf+1x2VlqpAXQvpDPcfBm70wk7l60rfLstb8+7w7EcZ0 FIX9V4d2LfkvUfL8Y/4ZAI4JJyTJTwS1mZAG1YZQXT1FQHvV2aISrKR0H2EPHb0wn9pno/sMiVlcT 693h94D6fX5pCzaQ8xKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1WZH-00FcAy-C0; Wed, 15 Jun 2022 17:12:35 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1WZE-00Fc9R-HT for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 17:12:33 +0000 Received: by mail-pf1-x42c.google.com with SMTP id s37so9328879pfg.11 for ; Wed, 15 Jun 2022 10:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ccRpeu9Qf2OqLxTVLl5CsFKFbl2V6F6Qu9vzaMjncjY=; b=V6Qh1XqQ6aLyfWteRAVp1mWPbgmHK2ojVydhIj9Ayyuy9FXVcLiMoRdl6T/Dtam+yq gzlRsFYCL3wDAHoNy9m7tEvuwwNi37nYeJZEbwnewZT6+Jyansn5NC9U+P8rO7ZvCXbu akOIzfSIsvnu7upTLdClpXf2gF534FmonjB2sTpt8pyZcS9h/GHynIPAle7I9oSgF/x0 Fq25dc6hfDpNhZjMNAbcRDpv9YzFFZX1/qYVpeubCJo6iQ7sOZAvB57wHVkt1Haz+15X RkbY1lwtAeqXX23bYP0N5WzV6cZ94IamUaAViHOtnwQVsZ6xZccfubWE4lpyJHxq+Lkv HviQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ccRpeu9Qf2OqLxTVLl5CsFKFbl2V6F6Qu9vzaMjncjY=; b=HJ/1YSW5kR5pMjtXt8BQH2WO6RMket/Cpl0UaqENaDCGXVaetYGrZcMKaYNpPfyJaB vWXtOyG3zPAv/q1LeqmnHzqCQsURZd+DvZacXjGw8uA5ADS65wB9WTp+7wdCli1NT4TD TsytzRa+cqF+cd9Ziyh6R0nIBg7NDd4M43AQ3ZoG6W5XcH7sUoCSRcr7VgeB84XVZ61q zblPWIU5UI9YD0FjpZBJzo1+qiQbplP7dHZKG7kCezPcQt5SmIJaCLKqWX3hmgGKboph TK9S9kiRxjVP55WBht30DCdSiPYMQ2DwqhtcOBpvuefWL7ChyZmpMDvLXn51ZAcpwOD+ ZETg== X-Gm-Message-State: AJIora9EhvkWpZhW4uQ2hR+egA8Manzm2+L3AHJXn6snYb/tpcbu2iAx u5RC5qYPzhk04T1fArWTq5kvEw== X-Google-Smtp-Source: AGRyM1vVGVybQm17dPGd+FhIlxcRdP6QS6r+mv/cGw2GaF/PGYUS5M0QxrjUT5ZmORm6aF7fCogmwg== X-Received: by 2002:a63:b55:0:b0:3fd:a384:bd10 with SMTP id a21-20020a630b55000000b003fda384bd10mr701815pgl.534.1655313150036; Wed, 15 Jun 2022 10:12:30 -0700 (PDT) Received: from google.com ([2620:15c:201:2:eaa0:bc6e:4256:1385]) by smtp.gmail.com with ESMTPSA id g12-20020a62f94c000000b0051be585ab1dsm10136981pfm.200.2022.06.15.10.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 10:12:29 -0700 (PDT) Date: Wed, 15 Jun 2022 10:12:23 -0700 From: Sami Tolvanen To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, maz@kernel.org, Kees Cook , Fangrui Song , Nick Desaulniers , Dan Li , Kees Cook Subject: Re: [PATCH v3 2/3] scs: add support for dynamic shadow call stacks Message-ID: References: <20220613134008.3760481-1-ardb@kernel.org> <20220613134008.3760481-3-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_101232_600731_094B8702 X-CRM114-Status: GOOD ( 22.39 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 14, 2022 at 08:20:13AM +0200, Ard Biesheuvel wrote: > On Mon, 13 Jun 2022 at 15:40, Ard Biesheuvel wrote: > > > > In order to allow arches to use code patching to conditionally emit the > > shadow stack pushes and pops, rather than always taking the performance > > hit even on CPUs that implement alternatives such as stack pointer > > authentication on arm64, add a Kconfig symbol that can be set by the > > arch to omit the SCS codegen itself, without otherwise affecting how > > support code for SCS and compiler options (for register reservation, for > > instance) are emitted. > > > > Also, add a static key and some plumbing to omit the allocation of > > shadow call stack for dynamic SCS configurations if SCS is disabled at > > runtime. > > > > Signed-off-by: Ard Biesheuvel > > Reviewed-by: Nick Desaulniers > > Reviewed-by: Kees Cook > > This patch needs the following hunk applied on top to fix a build > error reported by the bots: > > --- a/include/linux/scs.h > +++ b/include/linux/scs.h > @@ -57,6 +57,8 @@ DECLARE_STATIC_KEY_TRUE(dynamic_scs_enabled); > > static inline bool scs_is_dynamic(void) > { > + if (!IS_ENABLED(CONFIG_DYNAMIC_SCS)) > + return false; > return static_branch_likely(&dynamic_scs_enabled); > } With this: Reviewed-by: Sami Tolvanen Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel