android_kernel_samsung_msm8976/arch/mips/cavium-octeon
Aaro Koskinen d2a3ec399f MIPS: OCTEON: make get_system_type() thread-safe
commit 608308682addfdc7b8e2aee88f0e028331d88e4d 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:03:58 -07:00
..
executive Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-03-02 07:44:16 -08:00
.gitignore
Kconfig MIPS: Octeon: Adding driver to measure interrupt latency on Octeon. 2013-02-15 23:07:37 +01:00
Makefile MIPS: Octeon: Adding driver to measure interrupt latency on Octeon. 2013-02-15 23:07:37 +01:00
Platform
cpu.c
csrc-octeon.c
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
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 13:25:29 -07:00
octeon-memcpy.S MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
octeon-platform.c MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
octeon_3xxx.dts MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +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
serial.c MIPS: drivers: remove __dev* attributes. 2013-01-03 15:57:09 -08:00
setup.c MIPS: OCTEON: make get_system_type() thread-safe 2014-09-17 09:03:58 -07:00
smp.c MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00