aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hidraw.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-10-15 15:17:41 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 08:12:00 -0700
commit57d292bd7e6e72898e533687af481603597b1ca7 (patch)
treed9594d10bfc843b44eb4ad1b32f945b000330f8c /include/linux/hidraw.h
parentFix compile while compiling drivers/mmc/host/mmc_spi.o with !BLOCK (diff)
downloadlinux-dev-57d292bd7e6e72898e533687af481603597b1ca7.tar.xz
linux-dev-57d292bd7e6e72898e533687af481603597b1ca7.zip
HID: fix HIDIOCGRDESC memory access in hidraw
Fix bogus copying of data into userspace when HIDIOCGRDESC is issued. HID-transport layer makes sure that dev->hid->rdesc is not larger than HID_MAX_DESCRIPTOR_SIZE. Noticed-by: Al Viro <viro@ftp.linux.org.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/hidraw.h')
-rw-r--r--include/linux/hidraw.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
index 6676cd5e9954..0536f299f7ff 100644
--- a/include/linux/hidraw.h
+++ b/include/linux/hidraw.h
@@ -15,9 +15,11 @@
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <linux/hid.h>
+
struct hidraw_report_descriptor {
__u32 size;
- __u8 *value;
+ __u8 value[HID_MAX_DESCRIPTOR_SIZE];
};
struct hidraw_devinfo {
@@ -40,8 +42,6 @@ struct hidraw_devinfo {
/* kernel-only API declarations */
#ifdef __KERNEL__
-#include <linux/hid.h>
-
struct hidraw {
unsigned int minor;
int exist;