Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp215359pxb; Mon, 7 Feb 2022 09:34:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyQL7BuUlDJifdbd2N3/llASlJK8Cjs8b21RUPUnlX2gpbTpjqr4CiIF8rhr6nOy+g33SB X-Received: by 2002:a05:6402:354d:: with SMTP id f13mr524459edd.289.1644255295286; Mon, 07 Feb 2022 09:34:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644255295; cv=none; d=google.com; s=arc-20160816; b=lyZ+5apvKpSzAM54RPTZwOScWDmDCOWZHxo/aE+OXMdJX2a1Z09eXKkRnPWX59cqHO U2FLrO3aQW3MchQy42GTf2Nb2cZq9JwM5NfIghYRRZT11roSFhNBgWjbCNSqnt5SAxK5 R54/VmNHAUq+yqdTu8u7aizMqMSyK+Tg2NcCrDfDulbYHdWoQ8tiEujFmMCp13hO/+da 9oiksgAJK3A0IZKITX/LIgGWWlmjJjV01kGPUvTgb03eoFFy6PxOvATrRULuFRX9Nq7u 2yZLsbYaWch5csrY4F9MFu4DdNhDQmb9jvAvlrrgE2xCRDVbSnkiK3vGUTWxXLZK4BMg JN8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:dkim-signature; bh=KZUXWHIFV1YB3ZOn+MuG5OXYSvn3uZFEKSFPbT82ngg=; b=spdpoJfNtH7oah4sx87oqUzbBDsxqK6fSTZSkDsUkMat/fJRLImxzjNfLpMF46O1FE G8Gq+vfKPAYCtdiXYfLn/GruhC3LokwqJfsEIxgr/Vw+cBexiVsRm5OaQ5wHygg94cX1 7Qt5uIqkGraaMQPTJnXNaRFW++e/DkmjzwPCzx8FynMHnSsURFBZXOqfoW9IjBADzBfD bB9jS5e/SLL+VST7U9rZM4Pg77IA9Wz4dhwXe5uXfSqo1RO7gfOrGFm+/RQaWnsal0K9 bSEEu34AJolefXNkly9m1K/Pao/ML100TsSe90J4InuuarwwiguiIvNeYPh/d7H3eMeu z2kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=buPrFU01; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m1si7049771ejl.358.2022.02.07.09.34.30; Mon, 07 Feb 2022 09:34:55 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=buPrFU01; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236961AbiBDFUe (ORCPT + 99 others); Fri, 4 Feb 2022 00:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235223AbiBDFUd (ORCPT ); Fri, 4 Feb 2022 00:20:33 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4528C061714; Thu, 3 Feb 2022 21:20:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 50EE6B83686; Fri, 4 Feb 2022 05:20:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79EBAC004E1; Fri, 4 Feb 2022 05:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643952030; bh=YyMGbf0ZqsvTYLYfTUApEeUhPl/FcV973WctliE1Z1o=; h=In-Reply-To:References:Date:From:To:Subject:From; b=buPrFU01CDWVER/ma7HTnZDh7CghXByYF3YXoGL+umOx8QYZ4RlIyIGdjEbYBhZfS H+gFtOcVzQ8zLMhtb4xkd2N72QVwnBbts/XFuNmR9zcTk+sKhXxqOls2+aY/8k71Zw 0NaMBEcFMX1dWKQ52IP7ra3tUzVN6K201fnXQNoDXS+/hcLzh+XrcRUa4xJIwwqojJ eMblXiA1zoYA4YgCHlQGxYJc0kPdMcRt05JAXeS96mzKctLpBpIJncT9lRo49floaL d4g8BWOB16tblCO6IgKY5cg3OWSPxlzKrWClrXrLlEwXB1bhWE8D+cKnqq1+jg8DZ3 VMjOCarg8VLCw== Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 2CDBC27C0054; Fri, 4 Feb 2022 00:20:27 -0500 (EST) Received: from imap48 ([10.202.2.98]) by compute5.internal (MEProxy); Fri, 04 Feb 2022 00:20:27 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgeekgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedftehnugih ucfnuhhtohhmihhrshhkihdfuceolhhuthhosehkvghrnhgvlhdrohhrgheqnecuggftrf grthhtvghrnheptdfhheettddvtedvtedugfeuuefhtddugedvleevleefvdetleffgfef vdekgeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnugihodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeiudekheei fedvqddvieefudeiiedtkedqlhhuthhopeepkhgvrhhnvghlrdhorhhgsehlihhnuhigrd hluhhtohdruhhs X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id EDE8721E006E; Fri, 4 Feb 2022 00:20:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4586-g104bd556f9-fm-20220203.002-g104bd556 Mime-Version: 1.0 Message-Id: <6b04d8cb-844e-42a5-9ea2-db0e8eafaa19@www.fastmail.com> In-Reply-To: References: <87fsozek0j.ffs@tglx> Date: Thu, 03 Feb 2022 21:20:05 -0800 From: "Andy Lutomirski" To: "Rick P Edgecombe" , "Balbir Singh" , "H. Peter Anvin" , "Eugene Syromiatnikov" , "Peter Zijlstra (Intel)" , "Randy Dunlap" , "Kees Cook" , "Dave Hansen" , "Kirill A. Shutemov" , "Eranian, Stephane" , "linux-mm@kvack.org" , "Florian Weimer" , "Nadav Amit" , "Jann Horn" , "linux-arch@vger.kernel.org" , "kcc@google.com" , "Borislav Petkov" , "Oleg Nesterov" , "H.J. Lu" , "Weijiang Yang" , "Pavel Machek" , "Arnd Bergmann" , "Moreira, Joao" , "Thomas Gleixner" , "Mike Kravetz" , "the arch/x86 maintainers" , "linux-doc@vger.kernel.org" , "Dave Martin" , "john.allen@amd.com" , "Ingo Molnar" , "Shankar, Ravi V" , "Jonathan Corbet" , "Linux Kernel Mailing List" , "Linux API" , "Cyrill Gorcunov" Subject: Re: [PATCH 00/35] Shadow stacks for userspace Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 3, 2022, at 5:08 PM, Edgecombe, Rick P wrote: > Hi Thomas, >> > Signals >> > ------- >> > Originally signals placed the location of the shadow stack >> > restore >> > token inside the saved state on the stack. This was >> > problematic from a >> > past ABI promises perspective. What was the actual problem? >> > So the restore location was >> > instead just >> > assumed from the shadow stack pointer. This works because in >> > normal >> > allowed cases of calling sigreturn, the shadow stack pointer >> > should be >> > right at the restore token at that time. There is no >> > alternate shadow >> > stack support. If an alt shadow stack is added later we >> > would >> > need to >> >> So how is that going to work? altstack is not an esoteric corner >> case. > > My understanding is that the main usages for the signal stack were > handling stack overflows and corruption. Since the shadow stack only > contains return addresses rather than large stack allocations, and is > not generally writable or pivotable, I thought there was a good > possibility an alt shadow stack would not end up being especially > useful. Does it seem like reasonable guesswork? It's also used for things like DOSEMU that execute in a weird context and then trap back out to the outer program using a signal handler and an altstack. Also, imagine someone writing a SIGSEGV handler specifically intended to handle shadow stack overflow. The shadow stack can be pivoted using RSTORSSP.