aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hidraw.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-10-15 09:17:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 11:12:00 -0400
commit57d292bd7e6e72898e533687af481603597b1ca7 (patch)
treed9594d10bfc843b44eb4ad1b32f945b000330f8c /include/linux/hidraw.h
parent23fd50450a34f2558070ceabb0bfebc1c9604af5 (diff)
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 6676cd5e995..0536f299f7f 100644
--- a/include/linux/hidraw.h
+++ b/include/linux/hidraw.h
@@ -15,9 +15,11 @@
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 */ 16 */
17 17
18#include <linux/hid.h>
19
18struct hidraw_report_descriptor { 20struct hidraw_report_descriptor {
19 __u32 size; 21 __u32 size;
20 __u8 *value; 22 __u8 value[HID_MAX_DESCRIPTOR_SIZE];
21}; 23};
22 24
23struct hidraw_devinfo { 25struct hidraw_devinfo {
@@ -40,8 +42,6 @@ struct hidraw_devinfo {
40/* kernel-only API declarations */ 42/* kernel-only API declarations */
41#ifdef __KERNEL__ 43#ifdef __KERNEL__
42 44
43#include <linux/hid.h>
44
45struct hidraw { 45struct hidraw {
46 unsigned int minor; 46 unsigned int minor;
47 int exist; 47 int exist;