[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180126180722.GA13338@ZenIV.linux.org.uk>
Date: Fri, 26 Jan 2018 18:07:22 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...nel.org>, 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 09:40:23AM -0800, Linus Torvalds wrote:
> 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.
Umm... What about other architectures? Or do you want SYSCALL_DEFINE...
to be per-arch? I wonder how much would that "go through pt_regs" hurt
on something like sparc...
Powered by blists - more mailing lists