linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
	Linus Torvalds <torvalds@osdl.org>,
	Paul Mackerras <paulus@samba.org>
Subject: [POWERPC] Make OF interrupt tree parsing more strict
Date: Mon, 10 Jul 2006 16:42:33 +1000	[thread overview]
Message-ID: <1152513753.1576.64.camel@localhost.localdomain> (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.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

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 */

             reply	other threads:[~2006-07-10  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10  6:42 Benjamin Herrenschmidt [this message]
2006-07-10  9:24 ` [POWERPC] Make OF interrupt tree parsing more strict Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1152513753.1576.64.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).