From: Corey Minyard <minyard@acm.org>
To: Andrew Morton <akpm@osdl.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Cc: Adrian Bunk <bunk@kernel.org>, Stian Jordet <liste@jordet.net>
Subject: [PATCH] IPMI: fix comparison in demangle_device_id
Date: Sun, 21 Oct 2007 23:10:57 -0500 [thread overview]
Message-ID: <20071022041057.GA11676@minyard.local> (raw)
From: Corey Minyard <cminyard@mvista.com>
Coverity spotted some incorrect code in a recent change to the IPMI
driver; this patch make sure the data is really long enough to pull
the manufacturer id and product id out of a get device id message.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Stian Jordet <liste@jordet.net>
---
Index: linux-2.6.23/include/linux/ipmi_smi.h
===================================================================
--- linux-2.6.23.orig/include/linux/ipmi_smi.h
+++ linux-2.6.23/include/linux/ipmi_smi.h
@@ -173,7 +173,7 @@ static inline int ipmi_demangle_device_i
id->firmware_revision_2 = data[3];
id->ipmi_version = data[4];
id->additional_device_support = data[5];
- if (data_len >= 6) {
+ if (data_len >= 11) {
id->manufacturer_id = (data[6] | (data[7] << 8) |
(data[8] << 16));
id->product_id = data[9] | (data[10] << 8);
reply other threads:[~2007-10-22 4:11 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=20071022041057.GA11676@minyard.local \
--to=minyard@acm.org \
--cc=akpm@osdl.org \
--cc=bunk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liste@jordet.net \
/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