From: "Jan Beulich" Subject: Re: [PATCH] x86/cpuidle: prevent out of bounds array access Date: Fri, 22 May 2015 14:48:39 +0100 Message-ID: <555F4FD7020000780007D505@mail.emea.novell.com> References: <1432201161-17982-1-git-send-email-huaitong.han@intel.com> <555F2104.10700@citrix.com> <555F41C1020000780007D4AD@mail.emea.novell.com> <555F279C.9040905@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <555F279C.9040905@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Huaitong Han , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 22.05.15 at 14:57, wrote: > On 22/05/15 13:48, Jan Beulich wrote: >> ... resulting from fbeef5570c ("x86/cpuidle: get accurate C0 value with >> xenpm tool"). >> >> Reported-by: Andrew Cooper >> Signed-off-by: Jan Beulich > > This appears to fix the issue. > > However, looking at the other cases which play the same games, 0 is used > in preference to -1, given a zero last_state. It would seem logical to > follow suit here (although it is just a debugkey so I am not overly fussed). I have to admit that within that function (print_acpi_power()) I don't see any "other cases which play the same games". Or are you referring to pmstat_get_cx_stat()? While we shouldn't screw up stat->last there, I think I agree that we also should account things to C0 when we really don't know where things belong. V2 getting ready... Jan