android_kernel_google_msm/arch/mips/cavium-octeon
Aaro Koskinen 33df36f48f 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>
[lizf: Backport to 3.x: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2014-09-25 11:49:10 +08:00
..
executive MIPS: Octeon: Rearrange CVMX files in preperation for device tree 2011-12-07 22:03:29 +00:00
cpu.c MIPS: Octeon: Place cnmips_cu2_setup in __init memory. 2010-10-04 18:34:00 +01:00
csrc-octeon.c mips: add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:30:57 -04:00
dma-octeon.c MIPS: adapt for dma_map_ops changes 2012-03-28 16:36:32 +02:00
flash_setup.c mtd: do not use plain 0 as NULL 2012-03-27 00:53:20 +01:00
Kconfig MIPS: Octeon: Move some Ethernet support files out of staging. 2011-12-07 22:03:28 +00:00
Makefile MIPS: Octeon: Migrate to new platform makefile style. 2010-08-05 13:25:54 +01:00
octeon-irq.c MIPS: Octeon: Simplify irq_cpu_on/offline irq chip functions 2011-03-29 14:48:07 +02:00
octeon-memcpy.S
octeon-platform.c Fix common misspellings 2011-03-31 11:26:23 -03:00
octeon_boot.h MIPS: Octeon: HOTPLUG_CPU fixes. 2010-08-05 13:26:12 +01:00
Platform MIPS: Octeon: Migrate to new platform makefile style. 2010-08-05 13:25:54 +01:00
serial.c MIPS: Octeon: Use I/O clock rate for calculations. 2010-10-29 19:08:41 +01:00
setup.c MIPS: OCTEON: make get_system_type() thread-safe 2014-09-25 11:49:10 +08:00
smp.c documentation: remove references to cpu_*_map. 2012-03-29 15:38:31 +10:30