android_kernel_samsung_msm8976/arch/mips/kernel
Amanieu d'Antras a6bb935312 signal: fix information leak in copy_siginfo_from_user32
commit 3c00cb5e68dc719f2fc73a33b1b230aadfcb1309 upstream.

This function can leak kernel stack data when the user siginfo_t has a
positive si_code value.  The top 16 bits of si_code descibe which fields
in the siginfo_t union are active, but they are treated inconsistently
between copy_siginfo_from_user32, copy_siginfo_to_user32 and
copy_siginfo_to_user.

copy_siginfo_from_user32 is called from rt_sigqueueinfo and
rt_tgsigqueueinfo in which the user has full control overthe top 16 bits
of si_code.

This fixes the following information leaks:
x86:   8 bytes leaked when sending a signal from a 32-bit process to
       itself. This leak grows to 16 bytes if the process uses x32.
       (si_code = __SI_CHLD)
x86:   100 bytes leaked when sending a signal from a 32-bit process to
       a 64-bit process. (si_code = -1)
sparc: 4 bytes leaked when sending a signal from a 32-bit process to a
       64-bit process. (si_code = any)

parsic and s390 have similar bugs, but they are not vulnerable because
rt_[tg]sigqueueinfo have checks that prevent sending a positive si_code
to a different process.  These bugs are also fixed for consistency.

Signed-off-by: Amanieu d'Antras <amanieu@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-16 20:51:42 -07:00
..
.gitignore
8250-platform.c
asm-offsets.c MIPS: ASM offsets for VCPU arch specific fields. 2013-05-08 03:55:37 +02:00
binfmt_elfn32.c MIPS: Compat: Fix cputime_to_timeval() arguments in compat binfmt_elf. 2013-06-06 16:11:26 +02:00
binfmt_elfo32.c MIPS: asm/reg.h: Make 32- and 64-bit definitions available at the same time 2014-09-17 09:03:58 -07:00
bmips_vec.S
branch.c MIPS: MIPS16e: Support handling of delay slots. 2013-05-09 17:55:20 +02:00
cevt-bcm1480.c
cevt-ds1287.c
cevt-gic.c MIPS: Add new GIC clockevent driver. 2013-05-09 17:55:21 +02:00
cevt-gt641xx.c
cevt-r4k.c Merge branch 'mti-next' of git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill into mips-for-linux-next 2013-05-09 17:57:30 +02:00
cevt-sb1250.c
cevt-smtc.c
cevt-txx9.c
cpu-bugs64.c
cpu-probe.c MIPS: Consolidate idle loop / WAIT instruction support in a single file. 2013-05-22 01:34:25 +02:00
crash.c
crash_dump.c MIPS: Fix build error for crash_dump.c in 3.10-rc1 2013-05-17 20:36:02 +02:00
csrc-bcm1480.c
csrc-gic.c MIPS: Refactor GIC clocksource code. 2013-05-09 17:55:20 +02:00
csrc-ioasic.c
csrc-powertv.c
csrc-r4k.c
csrc-sb1250.c
early_printk.c
entry.S
ftrace.c MIPS: ftrace: Add missing CONFIG_DYNAMIC_FTRACE 2013-06-10 18:15:18 +02:00
genex.S MIPS: Idle: Break r4k_wait into two functions and fix it. 2013-05-22 01:34:28 +02:00
gpio_txx9.c
head.S
i8253.c
i8259.c
idle.c MIPS: Alchemy: fix wait function 2013-06-10 17:59:46 +02:00
irq-gic.c MIPS: GIC: Prevent array overrun 2014-09-17 09:03:58 -07:00
irq-gt641xx.c
irq-msc01.c MIPS: MSC: Prevent out-of-bounds writes to MIPS SC ioremap'd region 2014-07-06 18:54:13 -07:00
irq-rm7000.c
irq.c MIPS: Fix enabling of DEBUG_STACKOVERFLOW 2015-06-22 16:55:53 -07:00
irq_cpu.c MIPS: IRQ: Fix disable_irq on CPU IRQs 2015-02-11 14:48:16 +08:00
irq_txx9.c
jump_label.c
kgdb.c
kprobes.c kprobes/mips: Fix to check double free of insn slot 2013-05-22 12:48:30 +02:00
linux32.c unify compat fanotify_mark(2), switch to COMPAT_SYSCALL_DEFINE 2013-05-09 13:46:38 -04:00
machine_kexec.c
Makefile MIPS: Consolidate idle loop / WAIT instruction support in a single file. 2013-05-22 01:34:25 +02:00
mcount.S MIPS: mcount: Adjust stack pointer for static trace in MIPS32 2014-10-05 14:54:11 -07:00
mips-mt-fpaff.c MIPS: Fix sched_getaffinity with MT FPAFF enabled 2015-08-16 20:51:35 -07:00
mips-mt.c
mips_ksyms.c MIPS: Export FP functions used by lose_fpu(1) for KVM 2015-03-06 14:40:54 -08:00
mips_machine.c
module-rela.c
module.c
octeon_switch.S
perf_event.c
perf_event_mipsxx.c
proc.c MIPS: Idle: Consolidate all declarations in <asm/idle.h>. 2013-05-22 01:34:27 +02:00
process.c MIPS: Consolidate idle loop / WAIT instruction support in a single file. 2013-05-22 01:34:25 +02:00
prom.c
ptrace.c MIPS: Prevent user from setting FCSR cause bits 2014-09-17 09:03:58 -07:00
ptrace32.c
r4k_fpu.S
r4k_switch.S
r2300_fpu.S
r2300_switch.S
r6000_fpu.S
relocate_kernel.S
reset.c
rtlx.c MIPS: rtlx: Fix implicit declaration of function set_vi_handler() 2013-06-06 16:11:25 +02:00
scall32-o32.S MIPS: Cleanup flags in syscall flags handlers. 2014-09-17 09:03:58 -07:00
scall64-64.S MIPS: Cleanup flags in syscall flags handlers. 2014-09-17 09:03:58 -07:00
scall64-n32.S MIPS: Cleanup flags in syscall flags handlers. 2014-09-17 09:03:58 -07:00
scall64-o32.S MIPS: Cleanup flags in syscall flags handlers. 2014-09-17 09:03:58 -07:00
setup.c MIPS: add detect_memory_region() 2013-05-08 01:19:11 +02:00
signal-common.h
signal.c MIPS: microMIPS: Add vdso support. 2013-05-09 17:55:19 +02:00
signal32.c signal: fix information leak in copy_siginfo_from_user32 2015-08-16 20:51:42 -07:00
signal_n32.c
smp-bmips.c
smp-cmp.c
smp-mt.c MIPS: Move 'gic_present' to common location. 2013-05-09 17:55:20 +02:00
smp-up.c
smp.c MIPS: Fix kernel lockup or crash after CPU offline/online 2015-02-11 14:48:16 +08:00
smtc-asm.S MIPS: microMIPS: Add support for exception handling. 2013-05-09 17:55:18 +02:00
smtc-proc.c
smtc.c MIPS: Idle: Do address fiddlery in helper functions. 2013-05-22 01:34:28 +02:00
spinlock_test.c
spram.c
stacktrace.c
sync-r4k.c
syscall.c
time.c
topology.c
traps.c MIPS: Trap exception handling fixes 2013-05-23 17:47:51 +02:00
unaligned.c MIPS: Remove BUG_ON(!is_fpu_owner()) in do_ade() 2014-09-17 09:03:58 -07:00
vdso.c
vmlinux.lds.S
vpe.c
watch.c