x86: Make x32 syscall support conditional on a kernel parameter
authorBen Hutchings <ben@decadent.org.uk>
Mon, 12 Feb 2018 23:59:26 +0000 (23:59 +0000)
committerAurelien Jarno <aurel32@debian.org>
Fri, 2 Mar 2018 07:52:22 +0000 (07:52 +0000)
commit745c0811b54f31498fa956c7f2f69ebdd315f877
treedff41b856d65e1044a57921799fac409ebd96c42
parentfadd45dd26ac77fcaeed24e3f42b7a73928c25ac
x86: Make x32 syscall support conditional on a kernel parameter

Enabling x32 in the standard amd64 kernel would increase its attack
surface while provide no benefit to the vast majority of its users.
No-one seems interested in regularly checking for vulnerabilities
specific to x32 (at least no-one with a white hat).

Still, adding another flavour just to turn on x32 seems wasteful.  And
the only differences on syscall entry are a few instructions that mask
out the x32 flag and compare the syscall number.

Use a static key to control whether x32 syscalls are really enabled, a
Kconfig parameter to set its default value and a kernel parameter
"syscall.x32" to change it at boot time.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic features/x86
Gbp-Pq: Name x86-make-x32-syscall-support-conditional.patch
Documentation/kernel-parameters.txt
arch/x86/Kconfig
arch/x86/entry/common.c
arch/x86/entry/syscall_64.c
arch/x86/include/asm/elf.h
arch/x86/include/asm/syscall.h
arch/x86/include/asm/unistd.h