]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
powerpc: fix memory corruption by pnv_alloc_idle_core_states
authorJan Stancek <jstancek@redhat.com>
Tue, 31 Mar 2015 16:11:46 +0000 (18:11 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 1 Apr 2015 01:05:44 +0000 (12:05 +1100)
commitd52356e7f48e400ca258c6763a232a92fa82ff68
tree21d37003d5904a22276e2fe845aecd88580ad8e7
parente42391cd048809d903291d07f86ed3934ce138e9
powerpc: fix memory corruption by pnv_alloc_idle_core_states

Space allocated for paca is based off nr_cpu_ids,
but pnv_alloc_idle_core_states() iterates paca with
cpu_nr_cores()*threads_per_core, which is using NR_CPUS.

This causes pnv_alloc_idle_core_states() to write over memory,
which is outside of paca array and may later lead to various panics.

Fixes: 7cba160ad789 (powernv/cpuidle: Redesign idle states management)
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/cputhreads.h