linux/arch/tile/kernel
Amanieu d'Antras 3c00cb5e68 signal: fix information leak in copy_siginfo_from_user32
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>
2015-08-07 04:39:40 +03:00
..
vdso tile: vdso: use raw_read_seqcount_begin() in vdso 2015-06-04 13:31:27 -04:00
asm-offsets.c
backtrace.c
compat_signal.c signal: fix information leak in copy_siginfo_from_user32 2015-08-07 04:39:40 +03:00
compat.c
early_printk.c
entry.S tile: improve stack backtrace 2015-05-11 11:22:40 -04:00
ftrace.c tile: ftrace: fix function_graph tracer issues 2015-04-17 14:01:38 -04:00
hardwall.c tile: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
head_32.S
head_64.S
hvglue_trace.c tile: support delivering NMIs for multicore backtrace 2015-05-11 11:22:31 -04:00
hvglue.S tile: support delivering NMIs for multicore backtrace 2015-05-11 11:22:31 -04:00
intvec_32.S
intvec_64.S tile: support delivering NMIs for multicore backtrace 2015-05-11 11:22:31 -04:00
irq.c
kgdb.c
kprobes.c
machine_kexec.c
Makefile
mcount_64.S tile: ftrace: fix function_graph tracer issues 2015-04-17 14:01:38 -04:00
messaging.c
module.c module: remove mod arg from module_free, rename module_memfree(). 2015-01-20 11:38:33 +10:30
pci_gx.c PCI: Assign resources before drivers claim devices (pci_scan_root_bus()) 2015-03-19 10:17:13 -05:00
pci-dma.c
pci.c PCI: Assign resources before drivers claim devices (pci_scan_root_bus()) 2015-03-19 10:17:13 -05:00
perf_event.c
pmc.c
proc.c tile: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
process.c tile: improve stack backtrace 2015-05-11 11:22:40 -04:00
ptrace.c tile: support CONTEXT_TRACKING and thus NOHZ_FULL 2015-04-17 14:01:10 -04:00
reboot.c
regs_32.S
regs_64.S
relocate_kernel_32.S
relocate_kernel_64.S
setup.c tile: use free_bootmem_late() for initrd 2015-07-23 14:11:09 -04:00
signal.c tile: Remove signal translation and exec_domain 2015-04-12 21:03:27 +02:00
single_step.c tile: support CONTEXT_TRACKING and thus NOHZ_FULL 2015-04-17 14:01:10 -04:00
smp.c tile: support arch_irq_work_raise 2015-04-17 12:58:44 -04:00
smpboot.c
stack.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
sys.c
sysfs.c
tile-desc_32.c
tile-desc_64.c
time.c time: Rename timekeeper::tkr to timekeeper::tkr_mono 2015-03-27 09:45:06 +01:00
tlb.c
traps.c tile: improve stack backtrace 2015-05-11 11:22:40 -04:00
unaligned.c tile: support CONTEXT_TRACKING and thus NOHZ_FULL 2015-04-17 14:01:10 -04:00
usb.c tile: add init.h to usb.c to avoid compile failure 2015-06-16 14:12:41 -04:00
vdso.c
vmlinux.lds.S