From: David Howells <dhowells@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: dhowells@redhat.com, alan@redhat.com,
Markus.Lidel@shadowconnect.com, vvs@sw.ru,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] Mark i2o config broken on 64-bit platforms.
Date: Wed, 09 Jul 2008 13:07:47 +0100 [thread overview]
Message-ID: <6904.1215605267@redhat.com> (raw)
In-Reply-To: <20080709044743.0dd15a3f.akpm@linux-foundation.org>
Andrew Morton <akpm@linux-foundation.org> wrote:
> Is it actually known to be broken on 64-bit, or does it happen to work?
It's casting a 32-bit value to a userspace pointer and then passing that to
copy_to/from_user():
// TODO 64bit fix
if (copy_from_user
(p->virt,
(void __user *)(unsigned long)sg[i].
addr_bus, sg_size)) {
and:
// TODO 64bit fix
if (copy_to_user
((void __user *)sg[j].addr_bus, sg_list[j],
sg_size)) {
so someone's obviously aware that it is wrong. According to vc-annotate it's
been there since before Linus last reset the history, so obviously someone's
aware of it.
Another of these has in fact been cast in the way Linus objects to:
// TODO 64bit fix
if (copy_to_user
((void __user *)(u64) sg[j].addr_bus,
sg_list[j].virt, sg_size)) {
The problem, I suspect, is that userspace may have addresses that can't be
held in the 32-bit addr_bus value, but the 32-bit value is held in the
i2o_message struct:
static int i2o_cfg_passthru(unsigned long arg)
{
...
struct i2o_message *msg;
...
// TODO 64bit fix
sg = (struct sg_simple_element *)((&msg->u.head[0]) +
sg_offset);
...
}
and if these i2o_message structs are actually passed to the hardware, it may
not be possible to actually expand them, and looking at i2o_msg_post(), that
seems to be exactly what happens.
David
next prev parent reply other threads:[~2008-07-09 12:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-09 11:35 [PATCH] Mark i2o config broken on 64-bit platforms David Howells
2008-07-09 11:47 ` Andrew Morton
2008-07-09 12:07 ` David Howells [this message]
2008-07-09 13:47 ` Miquel van Smoorenburg
2008-07-09 14:15 ` David Howells
2008-07-09 15:08 ` Bernd Petrovitsch
2008-07-09 15:49 ` Alan Cox
2008-07-09 16:42 ` David Howells
2008-07-09 19:06 ` Miquel van Smoorenburg
2008-07-09 19:13 ` James Bottomley
2008-07-09 19:22 ` Miquel van Smoorenburg
2008-07-09 19:59 ` James Bottomley
2008-07-09 20:06 ` Miquel van Smoorenburg
2008-07-10 11:13 ` Alan Cox
2008-07-10 12:12 ` David Howells
2008-07-10 14:53 ` Alan Cox
2008-07-10 15:23 ` Alan Cox
2008-07-09 18:49 ` Miquel van Smoorenburg
2008-07-10 11:45 ` Alan Cox
2008-07-09 14:46 ` Alan Cox
2008-07-09 16:18 ` David Howells
2008-07-09 14:47 ` Alan Cox
2008-07-09 15:46 ` Jeff Garzik
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=6904.1215605267@redhat.com \
--to=dhowells@redhat.com \
--cc=Markus.Lidel@shadowconnect.com \
--cc=akpm@linux-foundation.org \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=vvs@sw.ru \
/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