Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755179AbbLGKHW (ORCPT ); Mon, 7 Dec 2015 05:07:22 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37051 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754658AbbLGKHT (ORCPT ); Mon, 7 Dec 2015 05:07:19 -0500 MIME-Version: 1.0 In-Reply-To: <1449083269-29614-1-git-send-email-geyslan@gmail.com> References: <1449083269-29614-1-git-send-email-geyslan@gmail.com> Date: Mon, 7 Dec 2015 11:07:18 +0100 Message-ID: Subject: Re: [PATCH] ia64: bitvector_process could read out of bounds From: Peter Senna Tschudin To: "Geyslan G. Bem" Cc: =?UTF-8?Q?Jo=C3=A3o_Guilherme_Victorino?= , raphaelscarv@gmail.com, Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1545 Lines: 46 On Wed, Dec 2, 2015 at 8:07 PM, Geyslan G. Bem wrote: > The units[] array could be accessed out of its bounds due the lack of > verification of the max vector value. > > To make this function not prone to error "P" and "E" suffixes were added. > Despite the new suffixes are unrelated to current ia64 vm magnitudes, they > make the code ready for it and avoid misleadings. I would mention that you also fix some white space issues, but other than that: Acked-by: Peter Senna Tschudin > > Catched using static analysis (cppcheck). > > Signed-off-by: Geyslan G. Bem > --- > arch/ia64/kernel/palinfo.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c > index c39c3cd..160aba1 100644 > --- a/arch/ia64/kernel/palinfo.c > +++ b/arch/ia64/kernel/palinfo.c > @@ -126,7 +126,7 @@ static const char *mem_attrib[]={ > static void bitvector_process(struct seq_file *m, u64 vector) > { > int i,j; > - static const char *units[]={ "", "K", "M", "G", "T" }; > + static const char *units[] = { "", "K", "M", "G", "T", "P", "E" }; > > for (i=0, j=0; i < 64; i++ , j=i/10) { > if (vector & 0x1) > -- > 2.6.2 > -- Peter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/