Input: evdev - fix EVIOCG{type} ioctl
authorDmitry Torokhov <[email protected]>
Mon, 6 Oct 2014 17:55:49 +0000 (10:55 -0700)
committerDmitry Torokhov <[email protected]>
Tue, 7 Oct 2014 16:55:01 +0000 (09:55 -0700)
commit7c4f56070fde2367766fa1fb04852599b5e1ad35
treebae58fba448d8f38252bc2d7bccffb03fa503a1d
parent042e1c79166b9250edd8262bea84e1703f27ad2e
Input: evdev - fix EVIOCG{type} ioctl

The 'max' size passed into the function is measured in number of bits
(KEY_MAX, LED_MAX, etc) so we need to convert it accordingly before trying
to copy the data out, otherwise we will try copying too much and end up
with up with a page fault.

Reported-by: Pavel Machek <[email protected]>
Reviewed-by: Pavel Machek <[email protected]>
Reviewed-by: David Herrmann <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
drivers/input/evdev.c