[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200403233924.GM23230@ZenIV.linux.org.uk>
Date: Sat, 4 Apr 2020 00:39:24 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
Peter Zijlstra <peterz@...radead.org>,
clang-built-linux@...glegroups.com,
Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Andy Lutomirski <luto@...nel.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
Marco Elver <elver@...gle.com>,
Brian Gerst <brgerst@...il.com>, Arnd Bergmann <arnd@...db.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Oleg Nesterov <oleg@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] x86: signal: move save_altstack_ex out of generic
headers
On Fri, Apr 03, 2020 at 04:16:06PM -0700, Nick Desaulniers wrote:
> In some configurations (clang+KASAN), sas_ss_reset() may emit calls to
> memset(). This is a problem for SMAP protections on x86, which should
> try to minimize calls to any function not already on short whitelist, in
> order to prevent leaking AC flags or being used as a gadget.
>
> Linus noted that unsafe_save_altstack() only has callsites in the
> arch-specific arch/x86/kernel/signal.c, and shouldn't be defined in arch
> independent headers.
>
> Split the logic of unsafe_save_altstack() into two, and move the definitions
> to arch/x86/include/asm/sigframe.h. This does less work with the SMAP
> guards down.
Just move that into signal_delivered() and that's it. SMAP or no SMAP -
doing that until the sigframe is set and we are committed to entering
the handler is wrong.
Powered by blists - more mailing lists