Commit 58d383a6222d66be9483598c51bae34e7d3c2c37

Authored by Segher Boessenkool
Committed by Linus Torvalds
1 parent f620753b95

[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 <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

arch/powerpc/kernel/prom_parse.c
... ... @@ -881,7 +881,7 @@
881 881 intsize = *tmp;
882 882  
883 883 /* Check index */
884   - if (index * intsize >= intlen)
  884 + if ((index + 1) * intsize > intlen)
885 885 return -EINVAL;
886 886  
887 887 /* Get new specifier and map it */