From: Segher Boessenkool Date: Mon, 10 Jul 2006 11:44:45 +0000 (-0700) Subject: [PATCH] powerpc: make OF interrupt tree parsing more strict X-Git-Tag: v2.6.18-rc2~187 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58d383a6222d66be9483598c51bae34e7d3c2c37;p=linux-2.6 [PATCH] powerpc: make OF interrupt tree parsing more strict 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 Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 21009b1f78..6a7e997c40 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c @@ -881,7 +881,7 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq intsize = *tmp; /* Check index */ - if (index * intsize >= intlen) + if ((index + 1) * intsize > intlen) return -EINVAL; /* Get new specifier and map it */