linux/arch/mips
James Hogan 86c2e14925 MIPS: Avoid accidental raw backtrace
commit 8542363633 upstream.

Since commit 81a76d7119 ("MIPS: Avoid using unwind_stack() with
usermode") show_backtrace() invokes the raw backtracer when
cp0_status & ST0_KSU indicates user mode to fix issues on EVA kernels
where user and kernel address spaces overlap.

However this is used by show_stack() which creates its own pt_regs on
the stack and leaves cp0_status uninitialised in most of the code paths.
This results in the non deterministic use of the raw back tracer
depending on the previous stack content.

show_stack() deals exclusively with kernel mode stacks anyway, so
explicitly initialise regs.cp0_status to KSU_KERNEL (i.e. 0) to ensure
we get a useful backtrace.

Fixes: 81a76d7119 ("MIPS: Avoid using unwind_stack() with usermode")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16656/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-09-15 18:30:17 +01:00
..
alchemy MIPS: Replace obsolete strict_strto call with kstrto 2014-06-04 22:50:40 +02:00
ar7 MIPS: Restore init.h usage to arch/mips/ar7/time.c 2014-03-26 23:09:23 +01:00
ath79 MIPS: ath79: make bootconsole wait for both THRE and TEMT 2016-08-22 22:37:53 +01:00
bcm47xx MIPS: BCM47XX: Fix button inversion for Asus WL-500W 2017-06-05 21:17:10 +01:00
bcm63xx MIPS: Use current_cpu_type() instead of c->cputype 2014-03-31 18:17:12 +02:00
boot MIPS: ZBOOT: add missing <linux/string.h> include 2014-10-05 13:41:02 -07:00
cavium-octeon MIPS: OCTEON: Fix copy_from_user fault handling for large buffers 2017-06-05 21:17:10 +01:00
cobalt MIPS: Cobalt: Move to 8250/16550 serial early printk driver 2013-10-29 21:24:38 +01:00
configs MIPS: ip27: Disable qlge driver in defconfig 2017-06-05 21:17:10 +01:00
dec Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-06-09 18:10:34 -07:00
emma MIPS: Remove panic_timeout settings 2013-11-26 12:12:27 +01:00
fw MIPS: DEC/SNI: O32 wrapper stack switching fixes 2014-05-13 00:29:35 +02:00
include MIPS: kprobes: flush_insn_slot should flush only if probe initialised 2017-09-15 18:30:06 +01:00
jazz Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-03-02 07:44:16 -08:00
jz4740 ASoC: qi_lb60: Use GPIO descriptor API 2014-04-23 12:18:36 +01:00
kernel MIPS: Avoid accidental raw backtrace 2017-09-15 18:30:17 +01:00
kvm KVM: MIPS: Flush KVM entry code from icache globally 2017-03-16 02:26:50 +00:00
lantiq Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-06-09 18:10:34 -07:00
lasat MIPS: Lasat: Replace del_timer by del_timer_sync 2014-03-31 18:17:12 +02:00
lib MIPS: uaccess: Take EVA into account in [__]clear_user 2016-01-25 10:43:31 +00:00
loongson MIPS: Loongson-3: Add IRQF_NO_SUSPEND to Cascade irqaction 2015-05-05 11:09:31 +01:00
loongson1 MIPS: Disable MIPS16/microMIPS crap for platforms not supporting these ASEs. 2014-05-23 15:12:37 +02:00
math-emu MIPS: Fix build with binutils 2.24.51+ 2017-04-04 22:21:53 +01:00
mm mm: larger stack guard gap, between vmas 2017-07-02 17:13:02 +01:00
mti-malta MIPS: Malta: Fix IOCU disable switch read for MIPS64 2016-11-20 01:17:36 +00:00
mti-sead3 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-06-09 18:10:34 -07:00
net bpf, mips: fix off-by-one in ctx offset allocation 2016-11-20 01:16:56 +00:00
netlogic MIPS: Netlogic: Fix assembler warning from smpboot.S 2017-06-05 21:16:46 +01:00
oprofile MIPS: oprofile: Fix backtrace on 64-bit kernel 2014-12-01 10:26:05 +00:00
paravirt mips: Update the email address of Geert Uytterhoeven 2014-06-02 16:34:41 +02:00
pci Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-06-09 18:10:34 -07:00
pmcs-msp71xx MIPS: MT: Remove SMTC support 2014-05-24 00:07:01 +02:00
pnx833x MIPS: PNX833x: Remove checks for CONFIG_I2C_PNX0105 2014-05-23 15:12:39 +02:00
power nosave: consolidate __nosave_{begin,end} in <asm/sections.h> 2015-05-06 10:24:18 +01:00
ralink MIPS: ralink: Cosmetic change to prom_init(). 2017-04-04 22:21:56 +01:00
rb532 MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
sgi-ip22 MIPS: IP22/IP28: Improve GIO support 2014-06-04 22:50:42 +02:00
sgi-ip27 MIPS: IP27: Fix __node_distances undefined error 2014-12-01 10:26:04 +00:00
sgi-ip32 MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
sibyte MIPS: SMP: Remove plat_smp_ops cpus_done method. 2014-05-27 11:06:42 +02:00
sni MIPS: Cleanup CP0 PRId and CP1 FPIR register access masks 2013-09-18 20:25:19 +02:00
txx9 MIPS: Replace calls to obsolete strict_strto call with kstrto* equivalents. 2014-06-04 22:50:41 +02:00
vr41xx MIPS: Idle: Consolidate all declarations in <asm/idle.h>. 2013-05-22 01:34:27 +02:00
Kbuild MIPS: net: Add BPF JIT 2014-05-30 16:10:20 +02:00
Kbuild.platforms MIPS: Enable build for new system 'paravirt' 2014-06-02 12:34:20 +02:00
Kconfig MIPS: Lasat: Fix build error if CRC32 is not enabled. 2014-06-26 14:43:01 +01:00
Kconfig.debug MIPS: MT: Remove SMTC support 2014-05-24 00:07:01 +02:00
Makefile MIPS: 'make -s' should be silent 2017-06-05 21:16:58 +01:00