linux/arch/arm64
Mark Rutland 39a90ca639 arm64: Survive invalid cpu enable-methods
Currently, if you pass the kernel a dtb where a cpu node has an
unsupported enable-method property (e.g. "not-psci"), it'll explode
horribly, as it iterates over the enable_ops array incorrectly. It
increments the pointer *at* the current element, rather than
incrementing the pointer *to* the current element. As the first two
elements pointed to structures that were contiguous in memory, this
happened to be equivalent. However the third element is NULL, so when
the list is exhausted, smp_get_enable_ops generates the wrong pointer,
and dereferences an arbitrary portion of memory, which currently happens
to contain zero.

This patch fixes this by indirecting the pointer one level, so we
iterate over the array elements correctly, avoiding the below panic:

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2013-04-25 17:45:54 +01:00
..
boot arm64: dts: prevent *.dtb from always being rebuilt 2013-01-14 08:08:28 -06:00
configs arm64: Kconfig.debug: Remove unused CONFIG_DEBUG_ERRORS 2013-03-19 16:19:19 +00:00
include arm64: Fix compat types affecting struct compat_stat 2013-04-25 17:45:50 +01:00
kernel arm64: Survive invalid cpu enable-methods 2013-04-25 17:45:54 +01:00
lib arm64: klib: Optimised atomic bitops 2013-03-21 17:39:31 +00:00
mm arm64: mm: Correct show_pte behaviour 2013-04-25 17:45:52 +01:00
Kconfig arm64: Do not select GENERIC_HARDIRQS_NO_DEPRECATED 2013-03-19 15:39:46 +00:00
Kconfig.debug arm64: Kconfig.debug: Remove unused CONFIG_DEBUG_ERRORS 2013-03-19 16:19:19 +00:00
Makefile arm64: Fix the dtbs target building 2012-12-10 20:24:57 -06:00