All of lore.kernel.org
 help / color / mirror / Atom feed
* goldfish driver: Missing get_user_pages in goldfish_pipe_read_write()
@ 2013-06-27 17:35 Mathieu Desnoyers
  2013-06-27 17:46 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Desnoyers @ 2013-06-27 17:35 UTC (permalink / raw)
  To: David 'Digit' Turner, Xiaohui Xin, Yunhong Jiang,
	Jun Nakajima, Tom Keel, Alan Cox, Greg Kroah-Hartman
  Cc: linux-kernel

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.

I see that this feature has been merged in Linux kernel 3.9, but the
FIXME is still there in 3.10-rc7. Any plans on fixing this ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-27 18:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-27 17:35 goldfish driver: Missing get_user_pages in goldfish_pipe_read_write() 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 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.