From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 9BB87679E7 for ; Mon, 10 Jul 2006 19:25:02 +1000 (EST) Subject: Re: [POWERPC] Make OF interrupt tree parsing more strict From: Benjamin Herrenschmidt To: Andrew Morton In-Reply-To: <1152513753.1576.64.camel@localhost.localdomain> References: <1152513753.1576.64.camel@localhost.localdomain> Content-Type: text/plain Date: Mon, 10 Jul 2006 19:24:28 +1000 Message-Id: <1152523468.1576.73.camel@localhost.localdomain> Mime-Version: 1.0 Cc: linuxppc-dev list , Linus Torvalds , Paul Mackerras List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2006-07-10 at 16:42 +1000, Benjamin Herrenschmidt wrote: > This patch fixes a bit of boundchecking in the new Open Firmware > interrupt tree parsing code. It's important that it fails when things > aren't correct in order to trigger fallback mecanisms that are necessary > to make some machines work properly. > > Signed-off-by: Benjamin Herrenschmidt Oh, and I forgot here: From: Segher Boessenkool Sorry about that ! > Index: linux-irq-work/arch/powerpc/kernel/prom_parse.c > =================================================================== > --- linux-irq-work.orig/arch/powerpc/kernel/prom_parse.c 2006-07-10 12:39:08.000000000 +1000 > +++ linux-irq-work/arch/powerpc/kernel/prom_parse.c 2006-07-10 12:43:51.000000000 +1000 > @@ -881,7 +881,7 @@ > intsize = *tmp; > > /* Check index */ > - if (index * intsize >= intlen) > + if ((index + 1) * intsize > intlen) > return -EINVAL; > > /* Get new specifier and map it */ > > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev