From 57d292bd7e6e72898e533687af481603597b1ca7 Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Mon, 15 Oct 2007 15:17:41 +0200 Subject: 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 Signed-off-by: Jiri Kosina Signed-off-by: Linus Torvalds --- include/linux/hidraw.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/linux/hidraw.h') diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h index 6676cd5e995..0536f299f7f 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 + 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 - struct hidraw { unsigned int minor; int exist; -- cgit v1.2.3