[POWERPC] Make OF interrupt tree parsing more strict

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Jul 10 19:24:28 EST 2006


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 <benh at kernel.crashing.org>

Oh, and I forgot here:

From: Segher Boessenkool <segher at kernel.crashing.org>

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 at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev




More information about the Linuxppc-dev mailing list