linux/arch
Anton Blanchard a35222e8ca powerpc/vdso64: Use double word compare on pointers
commit 5045ea3737 upstream.

__kernel_get_syscall_map() and __kernel_clock_getres() use cmpli to
check if the passed in pointer is non zero. cmpli maps to a 32 bit
compare on binutils, so we ignore the top 32 bits.

A simple test case can be created by passing in a bogus pointer with
the bottom 32 bits clear. Using a clk_id that is handled by the VDSO,
then one that is handled by the kernel shows the problem:

  printf("%d\n", clock_getres(CLOCK_REALTIME, (void *)0x100000000));
  printf("%d\n", clock_getres(CLOCK_BOOTTIME, (void *)0x100000000));

And we get:

  0
  -1

The bigger issue is if we pass a valid pointer with the bottom 32 bits
clear, in this case we will return success but won't write any data
to the pointer.

I stumbled across this issue because the LLVM integrated assembler
doesn't accept cmpli with 3 arguments. Fix this by converting them to
cmpldi.

Fixes: a7f290dad3 ("[PATCH] powerpc: Merge vdso's and add vdso support to 32 bits kernel")
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-02-23 03:54:06 +00:00
..
alpha alpha: fix copy_from_user() 2016-11-20 01:17:25 +00:00
arc arc: don't leak bits of kernel stack into coredump 2017-02-23 03:54:00 +00:00
arm ARM: dts: exynos: Fix mismatched value for SD4 pull up/down configuration on exynos4210 2017-02-23 03:54:00 +00:00
arm64 arm64: debug: avoid resetting stepping state machine when TIF_SINGLESTEP 2017-02-23 03:53:56 +00:00
avr32 avr32: fix 'undefined reference to `___copy_from_user' 2016-11-20 01:17:32 +00:00
blackfin blackfin: fix copy_from_user() 2016-11-20 01:17:30 +00:00
c6x C6x: time: Ensure consistency in __init 2015-05-06 11:33:02 +01:00
cris cris: buggered copy_from_user/copy_to_user/clear_user 2016-11-20 01:17:27 +00:00
frv frv: fix clear_user() 2016-11-20 01:17:27 +00:00
hexagon hexagon: fix strncpy_from_user() error return 2016-11-20 01:17:27 +00:00
ia64 ia64: copy_from_user() should zero the destination on access_ok() failure 2016-11-20 01:17:27 +00:00
m32r m32r: fix __get_user() 2016-11-20 01:17:30 +00:00
m68k m68k: Define asmlinkage_protect 2015-10-19 14:31:37 +01:00
metag metag: copy_from_user() should zero the destination on access_ok() failure 2016-11-20 01:17:27 +00:00
microblaze microblaze: fix __get_user() 2016-11-20 01:17:30 +00:00
mips KVM: MIPS: Drop other CPU ASIDs on guest MMU changes 2016-11-20 01:17:40 +00:00
mn10300 mn10300: copy_from_user() should zero on access_ok() failure... 2016-11-20 01:17:28 +00:00
openrisc openrisc: fix the fix of copy_from_user() 2016-11-20 01:17:32 +00:00
parisc parisc: fix copy_from_user() 2016-11-20 01:17:28 +00:00
powerpc powerpc/vdso64: Use double word compare on pointers 2017-02-23 03:54:06 +00:00
s390 s390: get_user() should zero on failure 2016-11-20 01:17:29 +00:00
score score: fix copy_from_user() and friends 2016-11-20 01:17:29 +00:00
sh sh: fix copy_from_user() 2016-11-20 01:17:29 +00:00
sparc sparc32: fix copy_from_user() 2016-11-20 01:17:30 +00:00
tile tile: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO 2016-11-20 01:16:58 +00:00
um fs/coredump: prevent fsuid=0 dumps into user-controlled directories 2016-05-01 00:06:04 +02:00
unicore32 nosave: consolidate __nosave_{begin,end} in <asm/sections.h> 2015-05-06 10:24:18 +01:00
x86 x86/dumpstack: Fix x86_32 kernel_stack_pointer() previous stack access 2017-02-23 03:53:55 +00:00
xtensa xtensa: clear all DBREAKC registers on start 2016-05-01 00:05:57 +02:00
.gitignore arch: Ignore arch/i386 and arch/x86_64 2008-01-19 21:29:39 -08:00
Kconfig uprobes: Kconfig dependency fix 2014-03-18 16:39:33 -04:00