Re: [PATCH v1 6/8] x86/entry/clearregs: Add number of arguments to syscall tables

From: Andi Kleen
Date: Tue Jan 09 2018 - 23:38:27 EST


On Tue, Jan 09, 2018 at 05:26:43PM -0800, Andy Lutomirski wrote:
>
>
> > On Jan 9, 2018, at 5:03 PM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
> >
> > From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> >
> > In order to sanitize the system call arguments properly
> > we need to know the number of syscall arguments for each
> > syscall. Add a new column to the 32bit and 64bit syscall
> > tables to list the number of arguments.
> >
>
> Surely we can do this in the SYSCALL_DEFINE macros. Or at least statically check it.

Possibly. The assembler would be much uglier as inline assembler though.
And adding the number shouldn't be a big burden when adding a system call.

I don't know how to check statically.

>
> Also, what attack are we protecting against anyway?

There's no specific attack here.

But the idea is to make it harder to inject values into the kernel to abuse
with speculation.

-Andi