]> git.baikalelectronics.ru Git - kernel.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)
commitd2dec51f8a13cd58ea256a28a03ee2bdbd67512a
tree21d37003d5904a22276e2fe845aecd88580ad8e7
parenta3296cc3fe121ed08bf7bc320cc777bd8dc8009c
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: 2c9657f4b0f9 (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