[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6b04d8cb-844e-42a5-9ea2-db0e8eafaa19@www.fastmail.com>
Date: Thu, 03 Feb 2022 21:20:05 -0800
From: "Andy Lutomirski" <luto@...nel.org>
To: "Rick P Edgecombe" <rick.p.edgecombe@...el.com>,
"Balbir Singh" <bsingharora@...il.com>,
"H. Peter Anvin" <hpa@...or.com>,
"Eugene Syromiatnikov" <esyr@...hat.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
"Randy Dunlap" <rdunlap@...radead.org>,
"Kees Cook" <keescook@...omium.org>,
"Dave Hansen" <dave.hansen@...ux.intel.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"Eranian, Stephane" <eranian@...gle.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"Florian Weimer" <fweimer@...hat.com>,
"Nadav Amit" <nadav.amit@...il.com>,
"Jann Horn" <jannh@...gle.com>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"kcc@...gle.com" <kcc@...gle.com>,
"Borislav Petkov" <bp@...en8.de>,
"Oleg Nesterov" <oleg@...hat.com>, "H.J. Lu" <hjl.tools@...il.com>,
"Weijiang Yang" <weijiang.yang@...el.com>,
"Pavel Machek" <pavel@....cz>, "Arnd Bergmann" <arnd@...db.de>,
"Moreira, Joao" <joao.moreira@...el.com>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Mike Kravetz" <mike.kravetz@...cle.com>,
"the arch/x86 maintainers" <x86@...nel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"Dave Martin" <Dave.Martin@....com>,
"john.allen@....com" <john.allen@....com>,
"Ingo Molnar" <mingo@...hat.com>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
"Jonathan Corbet" <corbet@....net>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
"Linux API" <linux-api@...r.kernel.org>,
"Cyrill Gorcunov" <gorcunov@...il.com>
Subject: Re: [PATCH 00/35] Shadow stacks for userspace
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.
Powered by blists - more mailing lists