Netdev List
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: David Miller <davem@davemloft.net>
Cc: shaddy_baddah@hotmail.com, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, Jean Tourrilhes <jt@hpl.hp.com>
Subject: Re: zd1211rw (2.6.22 sparc64): unaligned access (do_rx)
Date: Tue, 20 Nov 2007 14:15:40 +0100	[thread overview]
Message-ID: <1195564540.10920.13.camel@johannes.berg> (raw)
In-Reply-To: <20071120.043423.42170421.davem@davemloft.net> (sfid-20071120_123450_985935_82C552CF)

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]


> I think I've figured out what's happening here.
> 
> The kernel makes no effort whatsoever to translate iwe streams in
> compat environments.  And userspace then tries to "correct" this and
> does so miserably.  Likely this is what causes the bus error.

Quite possible. I wanted this fixed too but Jean refused to do it in the
kernel. And personally, I'm no longer touching wext with a 10 foot pole.
Too much backslash.

> The fix is that we need to add some handling code
> fs/compat_ioctl.c:do_wireless_ioctl() for the case where we are
> returning an iwe stream (SIOCGIWSCAN).
> 
> It should not be very difficult to do this, since the compat format
> will be the same size or smaller, it should be easy to recode the
> thing in-place in the user buffer.
> 
> So you make a pass over the user buffer fixing things up and then you
> adjust the iw_data length for the new size.
> 
> Alternatively, you can allocate a kernel buffer for this, use a 'fs =
> get_fs(); set_fs(KERNEL_DS); ioctl(); set_fs(fs);' sequence, fixup the
> iwe stream, then copy the everything back out to userspace.

That may work, but wext also broadcasts iw_point inside netlink messages
for scan notifications etc. I don't see a good way to fix this part.

> Then we can delete all of this incredibly stupid code in the wireless
> tools that attempts to fix this up in userspace.

I wish. Really, I do.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2007-11-20 13:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4740DF47.4040206@hotmail.com>
     [not found] ` <20071119.002755.77617097.davem@davemloft.net>
2007-11-20 12:34   ` zd1211rw (2.6.22 sparc64): unaligned access (do_rx) David Miller
2007-11-20 13:15     ` Johannes Berg [this message]

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=1195564540.10920.13.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=davem@davemloft.net \
    --cc=jt@hpl.hp.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shaddy_baddah@hotmail.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