From: Jeff Garzik <jgarzik@pobox.com>
To: glenn_engel@agilent.com
Cc: netdev@vger.kernel.org
Subject: Re: natsemi.c ioctl fix or mii register access
Date: Thu, 22 May 2008 14:04:48 -0400 [thread overview]
Message-ID: <4835B5C0.2000701@pobox.com> (raw)
In-Reply-To: <010200463BAAFF45926C5BFD8E21F515F523F0@cos-us-mb01.cos.agilent.com>
glenn_engel@agilent.com wrote:
> Hi,
>
> I recently discovered the ioctl implementation in natsemi.c had a few bugs in dealing with the user ioctls to send and receive MII commands (SIOCGMIIPHY and SIOCSMIIPHY).
>
> The specific problems noted and fixed:
>
> 1. The if_mii macro casts it's return to be (struct mii_ioctl_data *) but in reality it returns a pointer to the user space pointer (struct mii_ioctl_data**). This looks to be a problem with the mii_macro to me. I changed this to use the ifr_data macro instead.
>
> 2. Since the mii_ioctl_data structure resides in user space, it must be copied into kernel space before access and copied back for read results. References to the pointer were changed to point to the local copy (data-> changed to mii_data.)
This is completely incorrect. The copying is done for us inside net core.
Jeff
next prev parent reply other threads:[~2008-05-22 18:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-15 23:23 natsemi.c ioctl fix or mii register access glenn_engel
2008-05-16 20:57 ` Francois Romieu
2008-05-22 18:04 ` Jeff Garzik [this message]
2008-05-22 18:46 ` glenn_engel
2008-05-24 10:04 ` Francois Romieu
2008-05-27 16:29 ` glenn_engel
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=4835B5C0.2000701@pobox.com \
--to=jgarzik@pobox.com \
--cc=glenn_engel@agilent.com \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).