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 DF58BC54EBE for ; Thu, 12 Jan 2023 22:19:55 +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=2I5jl5hSB878oCV74VIhDy4M0yJo82wkQRueItMby+8=; b=2eoTywhu4HJilM b1oVEA4W89BgmQCZTFQxVa9cmCSDgL20Bik+PJBXcIRkz/Zp2gGtRMOPQJYDbpEDWUA3cUZ1PDGK6 xl3c6IV6t3q2yJL6gqtGq6u4O4B27GeE6Ae3gFGhv0kSXwIBLABkpxgWGcPSYg4elIa4kNnvIvfvE 95bin5DJL3Sb29NgAdDL6O0z+wELNMpwUCdqLw9yVCXFDczI4uJSI+Z714aMhT4tVc+FSnO3GeYFH OV9fW7sTMij3Cl+c1Ho76wBUnYFqr4+XjmqCJqdGkPdEcrPJW22sktIFibmKkdr6Gp0UMD6cf6izP Utzyb8dmeEoYe9xRbspA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG5uS-00HMJi-K7; Thu, 12 Jan 2023 22:18:56 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG5uQ-00HMJ1-54 for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2023 22:18:55 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 141so13780811pgc.0 for ; Thu, 12 Jan 2023 14:18:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NGWCQZt0ndr5LRawVoaH8JXC1+jIhPEw1IRYAwvgj2I=; b=nbKOTuzPzHXY37/fU5OUvDcglNXvKQRpdky0rF0YLhwd59gEEM5P/xZgL0JGPlu+nv PAudQymfQgNUlOdbCtEaPHFGtLSx6A6RG/zS0ex14TDXvJVM1iwWVOpUYqK9txDxUImX dnG7DsJB1Gzfu5EcCIBfm4kRdYq0cR/V0d5ag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NGWCQZt0ndr5LRawVoaH8JXC1+jIhPEw1IRYAwvgj2I=; b=2x7PArcThbr6bi0Hmh0vMZ41x2peRApx0CLYAawj+h2qUZs6trq43c3Sy7DTsGGcMa fML+f9kCtRrxb3Rb1jmOILvJfy8TYZH885MkX4EvI2jdxj2oavQq8WgLfSYt8s1vhRpy 7luAfVcx0txedWxKOiTqzsYkMZWf1xPgqYHHbI15AgufH+kaoAKuGI+xe064vHfnsUCP 9SDmGHSytcP2NFlBfmyTLYCpd/9Td9kGUeZc/Ep8wmwMrcti11PIXDEnPD6qnf89/qnh uNSAidcBQV4qSJpapZjMGq9q8rn1A6si5qbcFkm3Dp5lOoUpf2CzLmQ+UrAlHAee8/Hs o+/Q== X-Gm-Message-State: AFqh2kpIOaImS9OQVOUtkP/vLNnx+zIG0GpZ/ugpLUFv05rkFn9nWrF2 zybe6Zp7LGCmdyBy2RsG/u0HTA== X-Google-Smtp-Source: AMrXdXux9sV38i7tmiMCmvTbXMTAhfPkgVEcLuleuAgOT//br+cCtBX4TzCqtqE/RzaBZO+2cAQlVA== X-Received: by 2002:a05:6a00:4403:b0:581:dacb:1e6f with SMTP id br3-20020a056a00440300b00581dacb1e6fmr43851380pfb.0.1673561933202; Thu, 12 Jan 2023 14:18:53 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t2-20020aa79462000000b00582a224e738sm12367565pfq.63.2023.01.12.14.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 14:18:52 -0800 (PST) Date: Thu, 12 Jan 2023 14:18:51 -0800 From: Kees Cook To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, Sami Tolvanen Subject: Re: [PATCH v2 1/2] arm64: Always load shadow stack pointer directly from the task struct Message-ID: <202301121418.CF87AD042@keescook> References: <20230109174800.3286265-1-ardb@kernel.org> <20230109174800.3286265-2-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230109174800.3286265-2-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_141854_227745_05B2ED71 X-CRM114-Status: GOOD ( 12.41 ) 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 Mon, Jan 09, 2023 at 06:47:59PM +0100, Ard Biesheuvel wrote: > All occurrences of the scs_load macro load the value of the shadow call > stack pointer from the task which is current at that point. So instead > of taking a task struct register argument in the scs_load macro to > specify the task struct to load from, let's always reference the current > task directly. This should make it much harder to exploit any > instruction sequences reloading the shadow call stack pointer register > from memory. > > Signed-off-by: Ard Biesheuvel Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel