1
0
Fork 0
alistair23-linux/arch
Paul Moore 8b4b9f27e5 x86: remove the x32 syscall bitmask from syscall_get_nr()
Commit fca460f95e simplified the x32
implementation by creating a syscall bitmask, equal to 0x40000000, that
could be applied to x32 syscalls such that the masked syscall number
would be the same as a x86_64 syscall.  While that patch was a nice
way to simplify the code, it went a bit too far by adding the mask to
syscall_get_nr(); returning the masked syscall numbers can cause
confusion with callers that expect syscall numbers matching the x32
ABI, e.g. unmasked syscall numbers.

This patch fixes this by simply removing the mask from syscall_get_nr()
while preserving the other changes from the original commit.  While
there are several syscall_get_nr() callers in the kernel, most simply
check that the syscall number is greater than zero, in this case this
patch will have no effect.  Of those remaining callers, they appear
to be few, seccomp and ftrace, and from my testing of seccomp without
this patch the original commit definitely breaks things; the seccomp
filter does not correctly filter the syscalls due to the difference in
syscall numbers in the BPF filter and the value from syscall_get_nr().
Applying this patch restores the seccomp BPF filter functionality on
x32.

I've tested this patch with the seccomp BPF filters as well as ftrace
and everything looks reasonable to me; needless to say general usage
seemed fine as well.

Signed-off-by: Paul Moore <pmoore@redhat.com>
Link: http://lkml.kernel.org/r/20130215172143.12549.10292.stgit@localhost
Cc: <stable@vger.kernel.org>
Cc: Will Drewry <wad@chromium.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-04-02 14:38:09 -07:00
..
alpha Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
arc ARC: Fix the typo in event identifier flags used by ptrace 2013-03-20 18:45:45 +05:30
arm arm-soc: bug fixes for 3.9-rc4 2013-03-25 09:26:10 -07:00
arm64 Fix IS_ENABLED() usage typo (missing CONFIG_ prefix). 2013-03-28 13:45:49 -07:00
avr32 Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
blackfin Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
c6x Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
cris Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
frv Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
h8300 Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
hexagon Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
ia64 ia64 idle: delete stale (*idle)() function pointer 2013-03-29 11:12:25 -07:00
m32r UAPI: fix endianness conditionals in M32R's asm/stat.h 2013-03-13 15:21:49 -07:00
m68k Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
metag metag: Inhibit NUMA balancing. 2013-03-04 10:29:19 +00:00
microblaze Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
mips Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
mn10300 Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
openrisc openrisc: remove HAVE_VIRT_TO_BUS 2013-03-13 06:12:39 +01:00
parisc Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
powerpc powerpc: define the conditions where the ePAPR idle hcall can be supported 2013-03-26 08:47:27 +11:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2013-03-18 08:19:13 -07:00
score Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
sh hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2013-03-19 14:47:11 -07:00
tile A few bugfixes for md 2013-03-23 15:49:49 -07:00
um um: Use tty_port in SIGWINCH handler 2013-03-11 10:08:04 +01:00
unicore32 Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
x86 x86: remove the x32 syscall bitmask from syscall_get_nr() 2013-04-02 14:38:09 -07:00
xtensa Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00
.gitignore
Kconfig Select VIRT_TO_BUS directly where needed 2013-03-12 11:16:40 -07:00