From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH][RFC] ibm_newemac and SIOCGMIIREG
Date: Thu, 10 Jun 2010 16:31:29 +0200 [thread overview]
Message-ID: <201006101631.29591.arnd@arndb.de> (raw)
In-Reply-To: <4C10EFE0.6030106@harris.com>
On Thursday 10 June 2010, Steven A. Falco wrote:
> I believe there is a bug in the way the ibm_newemac driver handles the
> SIOCGMIIREG (and SIOCSMIIREG) ioctl. The problem is that emac_ioctl
> is handed a "struct ifreq *rq" which contains a user-land pointer to
> an array of 16-bit integers.
Did you actually see a bug here, or just think that this could be
a problem?
> However, emac_ioctl directly accesses the data, which doesn't work.
> I added the following patch to copy the data in and out.
>
> Please note that this patch was tested in an older kernel (2.6.30)
> because that is what we are using on our custom hardware. I think
> this is still a problem in the current code, but I'd like reviewers
> to take a look, to be sure.
The ifreq structure passed into the ndo_ioctl function is in kernel
space, it gets copied there by net/core/dev.c:dev_ioctl().
emac_ioctl only accesses the data in that structure, so a copy_from_user
is wrong here as far as I can tell.
Arnd
next prev parent reply other threads:[~2010-06-10 14:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-10 14:00 [PATCH][RFC] ibm_newemac and SIOCGMIIREG Steven A. Falco
2010-06-10 14:31 ` Arnd Bergmann [this message]
2010-06-10 15:27 ` Steven A. Falco
2010-06-10 17:03 ` Arnd Bergmann
2010-06-10 19:47 ` Steven A. Falco
2010-06-10 20:35 ` Arnd Bergmann
2010-06-10 21:26 ` Steven A. Falco
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=201006101631.29591.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linuxppc-dev@lists.ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.