USB: devio: Properly do access_ok() checks
authorMichael Buesch <mb@bu3sch.de>
Wed, 29 Jul 2009 09:39:03 +0000 (11:39 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 16 Aug 2009 21:27:21 +0000 (14:27 -0700)
commit0517d13f5206dcb7c09087ee3d7e522fdc9af2e3
treec9f34a9f4415dabc5ded7a47f0507419f58a7775
parent58d92bedd89043cf0ade84a902130078dc9094b8
USB: devio: Properly do access_ok() checks

commit 18753ebc8a98efe0e8ff6167afb31cef220c8e50 upstream.

access_ok() checks must be done on every part of the userspace structure
that is accessed. If access_ok() on one part of the struct succeeded, it
does not imply it will succeed on other parts of the struct. (Does
depend on the architecture implementation of access_ok()).

This changes the __get_user() users to first check access_ok() on the
data structure.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c