Skip to contentSkip to conversation

Make OF interrupt tree parsing more strict

POWERPC Benjamin Herrenschmidt 1 participant 2 messages Jul 10, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

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.

arch/powerpc/kernel/prom_parse.c +1 -1
Index: linux-irq-work/arch/powerpc/kernel/prom_parse.c
===================================================================
@@ -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 */
#1 lore raw
Quoted 6 lines · Benjamin Herrenschmidt

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.

Oh, and I forgot here:

From: Segher Boessenkool <[email protected]>

Sorry about that !

Quoted 19 lines

Index: linux-irq-work/arch/powerpc/kernel/prom_parse.c
===================================================================

arch/powerpc/kernel/prom_parse.c +1 -1
@@ -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
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev