linux/arch
Paul Burton b1442d39fa MIPS: Prevent user from setting FCSR cause bits
If one or more matching FCSR cause & enable bits are set in saved thread
context then when that context is restored the kernel will take an FP
exception. This is of course undesirable and considered an oops, leading
to the kernel writing a backtrace to the console and potentially
rebooting depending upon the configuration. Thus the kernel avoids this
situation by clearing the cause bits of the FCSR register when handling
FP exceptions and after emulating FP instructions.

However the kernel does not prevent userland from setting arbitrary FCSR
cause & enable bits via ptrace, using either the PTRACE_POKEUSR or
PTRACE_SETFPREGS requests. This means userland can trivially cause the
kernel to oops on any system with an FPU. Prevent this from happening
by clearing the cause bits when writing to the saved FCSR context via
ptrace.

This problem appears to exist at least back to the beginning of the git
era in the PTRACE_POKEUSR case.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: stable@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: stable@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7438/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2014-07-30 19:30:39 +02:00
..
alpha
arc ARC: [SMP] Enable icache coherency 2014-06-26 11:59:01 +05:30
arm ARM: SoC fixes for 3.16-rc 2014-07-13 12:10:18 -07:00
arm64 arm64: implement TASK_SIZE_OF 2014-07-08 17:30:59 +01:00
avr32
blackfin
c6x
cris
frv
hexagon
ia64 ia64: arch/ia64/include/uapi/asm/fcntl.h needs personality.h 2014-06-23 16:47:44 -07:00
m32r
m68k m68k: Export mach_random_get_entropy to modules 2014-07-11 10:37:53 +02:00
metag
microblaze
mips MIPS: Prevent user from setting FCSR cause bits 2014-07-30 19:30:39 +02:00
mn10300
openrisc
parisc Merge branch 'parisc-3.16-5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2014-07-13 12:02:05 -07:00
powerpc powerpc/perf: Never program book3s PMCs with values >= 0x80000000 2014-07-11 13:50:47 +10:00
s390 A bunch of one-liners (except the s390 one). 2014-07-01 09:27:34 -07:00
score
sh
sparc nmi: provide the option to issue an NMI back trace to every cpu but current 2014-06-23 16:47:44 -07:00
tile
um
unicore32 unicore32: Remove ARCH_HAS_CPUFREQ config option 2014-06-20 08:22:41 +08:00
x86 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-07-11 17:10:05 -07:00
xtensa
.gitignore
Kconfig