[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzr_tvdjsq1B+N1zrprNe-qfwo0At+r8uKiS=BGN_92vQ@mail.gmail.com>
Date: Fri, 26 Jan 2018 09:40:23 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andy Lutomirski <luto@...nel.org>
Cc: Alan Cox <alan@...ux.intel.com>,
David Laight <David.Laight@...lab.com>,
"the arch/x86 maintainers" <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jann Horn <jannh@...gle.com>,
Samuel Neves <samuel.c.p.neves@...il.com>,
Dan Williams <dan.j.williams@...el.com>,
Kernel Hardening <kernel-hardening@...ts.openwall.com>,
Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH] x86/retpoline/entry: Disable the entire SYSCALL64 fast
path with retpolines on
On Fri, Jan 26, 2018 at 7:57 AM, Andy Lutomirski <luto@...nel.org> wrote:
>
> I gave the rearrangement like this a try yesterday and it's a bit of a
> mess. Part of the problem is that there are a bunch of pieces of code
> that expect sys_xyz() to be actual callable functions.
That's not supposed to be a mess.
That's part of why we do that whole indirection through SYSC##xyz to
sys##_xyz: the asm-callable ones will do the full casting of
troublesome arguments (some architectures have C calling sequence
rules that have security issues, so we need to make sure that the
arguments actually follow the right rules and 'int' arguments are
properly sign-extended etc).
So that whole indirection could be made to *also* create another
version of the syscall that instead took the arguments from ptregs.
We already do exactly that for the tracing events: look how
FTRACE_SYSCALLS ends up creating that extra metadata.
The ptreg version should be done the same way: don't make 'sys_xyz()'
take a struct ptregs, instead make those SYSCALL_DEFINE*() macros
create a _new_ function called 'ptregs_xyz()' and then that function
does the argument unpacking.
Then the x86 system call table can just be switched over to call those
ptreg versions instead.
Linus
Powered by blists - more mailing lists