android_kernel_samsung_univ.../arch/mips
James Hogan a869e6b05d MIPS: Fix buffer overflow in syscall_get_arguments()
commit f4dce1ffd2e30fa31756876ef502ce6d2324be35 upstream.

Since commit 4c21b8fd8f ("MIPS: seccomp: Handle indirect system calls
(o32)"), syscall_get_arguments() attempts to handle o32 indirect syscall
arguments by incrementing both the start argument number and the number
of arguments to fetch. However only the start argument number needs to
be incremented. The number of arguments does not change, they're just
shifted up by one, and in fact the output array is provided by the
caller and is likely only n entries long, so reading more arguments
overflows the output buffer.

In the case of seccomp, this results in it fetching 7 arguments starting
at the 2nd one, which overflows the unsigned long args[6] in
populate_seccomp_data(). This clobbers the $s0 register from
syscall_trace_enter() which __seccomp_phase1_filter() saved onto the
stack, into which syscall_trace_enter() had placed its syscall number
argument. This caused Chromium to crash.

Credit goes to Milko for tracking it down as far as $s0 being clobbered.

Fixes: 4c21b8fd8f ("MIPS: seccomp: Handle indirect system calls (o32)")
Reported-by: Milko Leporis <milko.leporis@imgtec.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12213/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03 15:07:17 -08:00
..
alchemy
ar7
ath25
ath79
bcm47xx
bcm63xx
bmips
boot
cavium-octeon
cobalt
configs
dec
emma
fw
include MIPS: Fix buffer overflow in syscall_get_arguments() 2016-03-03 15:07:17 -08:00
jazz
jz4740
kernel
kvm
lantiq
lasat
lib
loongson32
loongson64 MIPS: hpet: Choose a safe value for the ETIME check 2016-03-03 15:07:17 -08:00
math-emu
mm MIPS: Fix some missing CONFIG_CPU_MIPSR6 #ifdefs 2016-03-03 15:07:17 -08:00
mti-malta
mti-sead3
net
netlogic
oprofile
paravirt
pci
pistachio
pmcs-msp71xx
pnx833x
power
ralink
rb532
sgi-ip22
sgi-ip27
sgi-ip32
sibyte
sni
txx9
vdso
vr41xx
xilfpga
Kbuild
Kbuild.platforms
Kconfig
Kconfig.debug
Makefile