Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 26 Jan 2018 10:23:23 -0800
From: Andy Lutomirski <>
To: Linus Torvalds <>
Cc: Al Viro <>, Andy Lutomirski <>, 
	Alan Cox <>, David Laight <>, 
	"the arch/x86 maintainers" <>, LKML <>, 
	Greg Kroah-Hartman <>, Jann Horn <>, 
	Samuel Neves <>, Dan Williams <>, 
	Kernel Hardening <>, Borislav Petkov <>
Subject: Re: [PATCH] x86/retpoline/entry: Disable the entire SYSCALL64 fast
 path with retpolines on

On Fri, Jan 26, 2018 at 10:13 AM, Linus Torvalds
<> wrote:
> On Fri, Jan 26, 2018 at 10:07 AM, Al Viro <> wrote:
>> 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...
> No, but I just talked to Will Deacon about register clearing on entry,
> and so I suspect that arm64 might want something similar too.
> So I think some opt-in for letting architectures add their own
> function would be good. Because it wouldn't be all architectures, but
> it probably _would_ be more than just x86.
> You need to add architecture-specific "load argX from ptregs" macros anyway.

I mocked that up, and it's straightforward.  I ended up with something like:

#define __ARCH_SYSCALL_ARGS(n, ...) (regs->di, ...)

(obviously modified so it actually compiles.)

The issue is that doing it this way gives us, effectively:

long sys_foo(int a, int b)
  body here;

long SyS_foo(const struct pt_regs *regs)
  return sys_foo(regs->di, regs->si);

whereas what we want is *static* long sys_foo(...).  So I could split
the macros into:

DEFINE_SYSCALL2(foo, ....)



or I could just fix up all the code that expects calling sys_foo()
across files to work.

My mockup patch doesn't actually work because of compat crap, but
that's manageable.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.