From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "David 'Digit' Turner" <digit@android.com>,
Xiaohui Xin <xiaohui.xin@intel.com>,
Yunhong Jiang <yunhong.jiang@intel.com>,
Jun Nakajima <jun.nakajima@intel.com>,
Tom Keel <thomas.keel@intel.com>, Alan Cox <alan@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: goldfish driver: Missing get_user_pages in goldfish_pipe_read_write()
Date: Thu, 27 Jun 2013 14:44:17 -0400 [thread overview]
Message-ID: <20130627184417.GA31031@Krystal> (raw)
In-Reply-To: <20130627181449.GA25159@kroah.com>
* Greg Kroah-Hartman (gregkh@linuxfoundation.org) wrote:
> On Thu, Jun 27, 2013 at 02:03:44PM -0400, Mathieu Desnoyers wrote:
> > * Greg Kroah-Hartman (gregkh@linuxfoundation.org) wrote:
> > > On Thu, Jun 27, 2013 at 01:35:32PM -0400, Mathieu Desnoyers wrote:
> > > > The following code snippet:
> > > >
> > > > drivers/platform/goldfish/goldfish_pipe.c:
> > > > goldfish_pipe_read_write()
> > > >
> > > > /* Ensure that the corresponding page is properly mapped */
> > > > /* FIXME: this isn't safe or sufficient - use get_user_pages */
> > > > if (is_write) {
> > > > char c;
> > > > /* Ensure that the page is mapped and readable */
> > > > if (__get_user(c, (char __user *)address)) {
> > > > if (!ret)
> > > > ret = -EFAULT;
> > > > break;
> > > > }
> > > > } else {
> > > > /* Ensure that the page is mapped and writable */
> > > > if (__put_user(0, (char __user *)address)) {
> > > > if (!ret)
> > > > ret = -EFAULT;
> > > > break;
> > > > }
> > > > }
> > > >
> > > > Seems to lack the kind of validation required to make it fail properly
> > > > if the memory range is not fully populated.
> > >
> > > This is an emulated platform only, so it's probably not a big deal,
> > > right?
> >
> > You're probably right. As long as it is not configured and somehow still
> > accessible on a production device.
>
> There is no device that could ever be "production" for this emulated
> hardware platform, unless a desktop system wants to "emulate" the
> android userspace system somehow. Then it could be "real", but even
> then, how would a user application get access to this codepath?
I think it would depend on the user access rights given to
/dev/qemu_pipe. Assuming it would be only accessible by root, this would
minimize the risks even more.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
prev parent reply other threads:[~2013-06-27 18:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-27 17:35 Mathieu Desnoyers
2013-06-27 17:46 ` Greg Kroah-Hartman
2013-06-27 18:03 ` Mathieu Desnoyers
2013-06-27 18:14 ` Greg Kroah-Hartman
2013-06-27 18:44 ` Mathieu Desnoyers [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=20130627184417.GA31031@Krystal \
--to=mathieu.desnoyers@efficios.com \
--cc=alan@linux.intel.com \
--cc=digit@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=jun.nakajima@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.keel@intel.com \
--cc=xiaohui.xin@intel.com \
--cc=yunhong.jiang@intel.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
Powered by JetHome