From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] rio: fix array checking
Date: Mon, 16 Oct 2006 16:28:44 +0100 [thread overview]
Message-ID: <1161012524.24237.74.camel@localhost.localdomain> (raw)
Found by an analysis tool and reported to the list. Fix is simple enough
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.19-rc1-mm1/drivers/char/rio/rioctrl.c linux-2.6.19-rc1-mm1/drivers/char/rio/rioctrl.c
--- linux.vanilla-2.6.19-rc1-mm1/drivers/char/rio/rioctrl.c 2006-10-13 15:06:33.000000000 +0100
+++ linux-2.6.19-rc1-mm1/drivers/char/rio/rioctrl.c 2006-10-14 18:55:37.000000000 +0100
@@ -662,7 +662,7 @@
p->RIOError.Error = COPYIN_FAILED;
return -EFAULT;
}
- if (portStats.port >= RIO_PORTS) {
+ if (portStats.port < 0 || portStats.port >= RIO_PORTS) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
return -ENXIO;
}
@@ -702,7 +702,7 @@
p->RIOError.Error = COPYIN_FAILED;
return -EFAULT;
}
- if (portStats.port >= RIO_PORTS) {
+ if (portStats.port < 0 || portStats.port >= RIO_PORTS) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
return -ENXIO;
}
reply other threads:[~2006-10-16 15:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1161012524.24237.74.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®