From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753163AbbDACkn (ORCPT ); Tue, 31 Mar 2015 22:40:43 -0400 Received: from ozlabs.org ([103.22.144.67]:49327 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbbDACkk (ORCPT ); Tue, 31 Mar 2015 22:40:40 -0400 Message-ID: <1427856038.4256.7.camel@ellerman.id.au> Subject: Re: [PATCH] powerpc: fix memory corruption by pnv_alloc_idle_core_states From: Michael Ellerman To: Jan Stancek Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, benh@kernel.crashing.org, paulus@samba.org, mikey@neuling.org, shreyas@linux.vnet.ibm.com, preeti@linux.vnet.ibm.com, sbest@redhat.com Date: Wed, 01 Apr 2015 13:40:38 +1100 In-Reply-To: <67174f780b3615749546d5a6d5bfba4c4f26a855.1427818011.git.jstancek@redhat.com> References: <67174f780b3615749546d5a6d5bfba4c4f26a855.1427818011.git.jstancek@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-03-31 at 18:11 +0200, Jan Stancek wrote: > 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 Thanks. I'll send that to Linus in the next day or two and mark it for stable as well. cheers