linux/arch
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>
History 2014-09-17 09:19:16 -07:00
..
alpha alpha: fix broken network checksum 2014-01-31 09:21:55 -08:00
arc ARC: Implement ptrace(PTRACE_GET_THREAD_AREA) 2014-07-28 08:06:04 -07:00
arm ARM: OMAP2+: hwmod: Rearm wake-up interrupts for DT when MUSB is idled 2014-09-05 16:34:17 -07:00
arm64 locking/mutex: Disable optimistic spinning on some architectures 2014-07-28 08:06:03 -07:00
avr32 avr32: add generic vga.h to Kbuild 2014-02-17 11:24:48 +01:00
blackfin Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-01-31 09:31:14 -08:00
c6x Build fix for c6x 2014-03-07 09:52:46 -08:00
cris cris: convert ffs from an object-like macro to a function-like macro 2014-03-10 17:26:21 -07:00
frv Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2014-01-30 16:58:05 -08:00
hexagon Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
ia64 hugetlb: restrict hugepage_migration_support() to x86_64 2014-06-30 20:11:53 -07:00
m32r Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
m68k m68k: Skip futex_atomic_cmpxchg_inatomic() test 2014-04-14 06:50:05 -07:00
metag parisc,metag: Do not hardcode maximum userspace stack size 2014-07-17 16:21:03 -07:00
microblaze microblaze: Fix a typo when disabling stack protection 2014-02-10 07:44:11 +01:00
mips MIPS: OCTEON: make get_system_type() thread-safe 2014-09-17 09:19:16 -07:00
mn10300 Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2014-01-30 16:58:05 -08:00
openrisc OpenRISC updates for 3.14 2014-01-30 17:08:41 -08:00
parisc parisc: Remove SA_RESTORER define 2014-07-31 12:52:56 -07:00
powerpc powerpc/thp: Use ACCESS_ONCE when loading pmdp 2014-09-17 09:19:11 -07:00
s390 s390/locking: Reenable optimistic spinning 2014-09-17 09:19:07 -07:00
score Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-01-31 09:31:14 -08:00
sh hugetlb: restrict hugepage_migration_support() to x86_64 2014-06-30 20:11:53 -07:00
sparc arch/sparc/math-emu/math_32.c: drop stray break operator 2014-08-14 09:38:26 +08:00
tile hugetlb: restrict hugepage_migration_support() to x86_64 2014-06-30 20:11:53 -07:00
um Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2014-01-26 11:06:16 -08:00
unicore32 arch/unicore32/mm/alignment.c: include "asm/pgtable.h" to avoid compiling error 2014-07-09 11:18:29 -07:00
x86 x86/xen: resume timer irqs early 2014-09-05 16:34:16 -07:00
xtensa xtensa: add fixup for double exception raised in window overflow 2014-08-07 14:52:39 -07:00
.gitignore arch: Ignore arch/i386 and arch/x86_64 2008-01-19 21:29:39 -08:00
Kconfig stackprotector: Introduce CONFIG_CC_STACKPROTECTOR_STRONG 2013-12-20 09:38:40 +01:00