lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 27 Jun 2013 14:44:17 -0400
From:	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	David 'Digit' Turner <digit@...roid.com>,
	Xiaohui Xin <xiaohui.xin@...el.com>,
	Yunhong Jiang <yunhong.jiang@...el.com>,
	Jun Nakajima <jun.nakajima@...el.com>,
	Tom Keel <thomas.keel@...el.com>,
	Alan Cox <alan@...ux.intel.com>, linux-kernel@...r.kernel.org
Subject: Re: goldfish driver: Missing get_user_pages in
	goldfish_pipe_read_write()

* Greg Kroah-Hartman (gregkh@...uxfoundation.org) wrote:
> On Thu, Jun 27, 2013 at 02:03:44PM -0400, Mathieu Desnoyers wrote:
> > * Greg Kroah-Hartman (gregkh@...uxfoundation.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ