From: Jeff Garzik <jeff@garzik.org>
To: markus.lidel@shadowconnect.com, Andrew Morton <akpm@osdl.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] I2O: mark i2o_config broken on 64-bit
Date: Sun, 1 Oct 2006 11:56:36 -0400 [thread overview]
Message-ID: <20061001155636.GA6836@havoc.gtf.org> (raw)
Code comments, reading the code, and gcc warnings all indicate that this
module isn't safe at all on 64-bit.
Disable this one I2O module on 64-bit, and update the bug indicator
comments to be to more grep-able.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig
index 6443392..0661599 100644
--- a/drivers/message/i2o/Kconfig
+++ b/drivers/message/i2o/Kconfig
@@ -56,7 +56,7 @@ config I2O_EXT_ADAPTEC_DMA64
config I2O_CONFIG
tristate "I2O Configuration support"
- depends on I2O
+ depends on I2O && 32BIT
---help---
Say Y for support of the configuration interface for the I2O adapters.
If you have a RAID controller from Adaptec and you want to use the
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 7d23e08..69666e8 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -600,7 +600,7 @@ static int i2o_cfg_passthru32(struct fil
rcode = -EFAULT;
goto cleanup;
}
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
sg = (struct sg_simple_element *)((&msg->u.head[0]) +
sg_offset);
sg_count =
@@ -640,7 +640,7 @@ static int i2o_cfg_passthru32(struct fil
/* Copy in the user's SG buffer if necessary */
if (sg[i].
flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) {
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
if (copy_from_user
(p->virt,
(void __user *)(unsigned long)sg[i].
@@ -652,7 +652,7 @@ static int i2o_cfg_passthru32(struct fil
goto sg_list_cleanup;
}
}
- //TODO 64bit fix
+ //FIXME: broken on 64-bit
sg[i].addr_bus = (u32) p->phys;
}
}
@@ -667,7 +667,7 @@ static int i2o_cfg_passthru32(struct fil
u32 msg[I2O_OUTBOUND_MSG_FRAME_SIZE];
/* Copy back the Scatter Gather buffers back to user space */
u32 j;
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
struct sg_simple_element *sg;
int sg_size;
@@ -688,7 +688,7 @@ static int i2o_cfg_passthru32(struct fil
sg_count =
(size - sg_offset * 4) / sizeof(struct sg_simple_element);
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
sg = (struct sg_simple_element *)(msg + sg_offset);
for (j = 0; j < sg_count; j++) {
/* Copy out the SG list to user's buffer if necessary */
@@ -696,7 +696,7 @@ static int i2o_cfg_passthru32(struct fil
(sg[j].
flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR */ )) {
sg_size = sg[j].flag_count & 0xffffff;
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
if (copy_to_user
((void __user *)(u64) sg[j].addr_bus,
sg_list[j].virt, sg_size)) {
@@ -833,7 +833,7 @@ static int i2o_cfg_passthru(unsigned lon
rcode = -EFAULT;
goto cleanup;
}
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
sg = (struct sg_simple_element *)((&msg->u.head[0]) +
sg_offset);
sg_count =
@@ -870,7 +870,7 @@ static int i2o_cfg_passthru(unsigned lon
/* Copy in the user's SG buffer if necessary */
if (sg[i].
flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) {
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
if (copy_from_user
(p, (void __user *)sg[i].addr_bus,
sg_size)) {
@@ -881,7 +881,7 @@ static int i2o_cfg_passthru(unsigned lon
goto sg_list_cleanup;
}
}
- //TODO 64bit fix
+ //FIXME: broken on 64-bit
sg[i].addr_bus = virt_to_bus(p);
}
}
@@ -896,7 +896,7 @@ static int i2o_cfg_passthru(unsigned lon
u32 msg[128];
/* Copy back the Scatter Gather buffers back to user space */
u32 j;
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
struct sg_simple_element *sg;
int sg_size;
@@ -917,7 +917,7 @@ static int i2o_cfg_passthru(unsigned lon
sg_count =
(size - sg_offset * 4) / sizeof(struct sg_simple_element);
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
sg = (struct sg_simple_element *)(msg + sg_offset);
for (j = 0; j < sg_count; j++) {
/* Copy out the SG list to user's buffer if necessary */
@@ -925,7 +925,7 @@ static int i2o_cfg_passthru(unsigned lon
(sg[j].
flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR */ )) {
sg_size = sg[j].flag_count & 0xffffff;
- // TODO 64bit fix
+ // FIXME: broken on 64-bit
if (copy_to_user
((void __user *)sg[j].addr_bus, sg_list[j],
sg_size)) {
next reply other threads:[~2006-10-01 15:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-01 15:56 Jeff Garzik [this message]
2006-10-01 16:11 ` Roland Dreier
2006-10-01 16:45 ` Markus Lidel
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=20061001155636.GA6836@havoc.gtf.org \
--to=jeff@garzik.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.lidel@shadowconnect.com \
/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®