linux/arch/mips/cavium-octeon
Aaro Koskinen 1040b2300e MIPS: OCTEON: make get_system_type() thread-safe
commit 608308682a upstream.

get_system_type() is not thread-safe on OCTEON. It uses static data,
also more dangerous issue is that it's calling cvmx_fuse_read_byte()
every time without any synchronization. Currently it's possible to get
processes stuck looping forever in kernel simply by launching multiple
readers of /proc/cpuinfo:

	(while true; do cat /proc/cpuinfo > /dev/null; done) &
	(while true; do cat /proc/cpuinfo > /dev/null; done) &
	...

Fix by initializing the system type string only once during the early
boot.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
Patchwork: http://patchwork.linux-mips.org/patch/7437/
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-17 09:19:16 -07:00
..
executive MIPS: OCTEON: Supply OCTEON+ USB nodes in internal device trees. 2014-01-23 13:02:35 +01:00
.gitignore MIPS: Octeon: Add device tree source files. 2012-07-23 13:54:52 +01:00
Kconfig MIPS: OCTEON: Get rid of CONFIG_CAVIUM_OCTEON_HW_FIX_UNALIGNED 2013-06-10 18:01:25 +02:00
Makefile Merge branch '3.10-fixes' into mips-for-linux-next 2013-07-12 18:11:43 +02:00
Platform MIPS: OCTEON: Rename Kconfig CAVIUM_OCTEON_REFERENCE_BOARD to CAVIUM_OCTEON_SOC 2013-06-10 18:01:25 +02:00
cpu.c MIPS: Octeon: Place cnmips_cu2_setup in __init memory. 2010-10-04 18:34:00 +01:00
csrc-octeon.c MIPS: Optimize current_cpu_type() for better code. 2013-09-17 18:50:53 +02:00
dma-octeon.c x86: Don't panic if can not alloc buffer for swiotlb 2013-01-29 19:36:53 -08:00
flash_setup.c mips/octeon: 16-Bit NOR flash was not being detected during boot 2012-11-09 11:37:16 +01:00
oct_ilm.c MIPS: Octeon: Adding driver to measure interrupt latency on Octeon. 2013-02-15 23:07:37 +01:00
octeon-irq.c genirq: Allow forcing cpu affinity of interrupts 2014-06-07 10:28:08 -07:00
octeon-memcpy.S MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
octeon-platform.c MIPS: OCTEON: Supply OCTEON+ USB nodes in internal device trees. 2014-01-23 13:02:35 +01:00
octeon_3xxx.dts MIPS: OCTEON: Supply OCTEON+ USB nodes in internal device trees. 2014-01-23 13:02:35 +01:00
octeon_68xx.dts MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
octeon_boot.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
setup.c MIPS: OCTEON: make get_system_type() thread-safe 2014-09-17 09:19:16 -07:00
smp.c mips: delete non-required instances of include <linux/init.h> 2014-01-24 22:39:56 +01:00