]> git.baikalelectronics.ru Git - kernel.git/commit
Input: evdev - fix EVIOCG{type} ioctl
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 6 Oct 2014 17:55:49 +0000 (10:55 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 7 Oct 2014 16:55:01 +0000 (09:55 -0700)
commit4a962a1d09ab2e33836f878c5f9806a309d606f1
treebae58fba448d8f38252bc2d7bccffb03fa503a1d
parent867802e96cba659da81472c39749cb52722b0ff7
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 <pavel@ucw.cz>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/evdev.c