]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <sasha.levin@oracle.com>
Thu, 23 Apr 2015 18:58:27 +0000 (14:58 -0400)
commit70213cdd6bf259a1844a7498e360cc1adbd5c306
tree5fbd20f16f758f1a12d2bc6236b42c00511c6f8f
parent604696d8b5d9ebf2f5af9bf46ac76519b831435f
powerpc: fix memory corruption by pnv_alloc_idle_core_states

[ Upstream commit d52356e7f48e400ca258c6763a232a92fa82ff68 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/powerpc/include/asm/cputhreads.h