libevdev/test
Peter Hutterer 66fee1bec4 Cap slot values to the announced maximum
A malicious device may announce N slots but then send a slot index >= N. The
slot state is almost always allocated (definitely the case in libevdev and
true for most callers), so providing a slot number higher than the announced
maximum is likely to lead to invalid dereferences. Don't allow that.
Likewise, don't allow negative slot numbers.

Note that the kernel filters these events anyway, the only way to trigger this
is to change the device fd to something outside the kernel's control.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2014-03-06 14:30:03 +10:00
..
.gitignore Add a test for EVIOCREVOKE 2014-02-26 07:22:04 +10:00
Makefile.am Add a test for EVIOCREVOKE 2014-02-26 07:22:04 +10:00
test-common-uinput.c test: fix memleak when using the test-uinput device 2014-02-27 11:08:51 +10:00
test-common-uinput.h test: provide wrapper for fetching the devnode from a uinput test device 2013-09-13 08:59:06 +10:00
test-common.c test: abort on unexpected log messages 2014-01-22 09:14:40 +10:00
test-common.h test: abort on unexpected log messages 2014-01-22 09:14:40 +10:00
test-compile-pedantic.c test: add a build test for -Wpedantic 2013-11-23 09:00:53 +10:00
test-event-codes.c Provide separate lookup functions for zero-terminated strings 2013-11-01 08:18:41 +10:00
test-event-names.c test: remove NULL test for SW_MAX, 3.13 defines SW_MUTE_DEVICE 2014-01-29 15:08:12 +10:00
test-int-queue.c test: remove a bunch of superfluous empty lines 2014-02-25 13:05:30 +10:00
test-kernel.c Add a test for EVIOCREVOKE 2014-02-26 07:22:04 +10:00
test-libevdev-events.c Cap slot values to the announced maximum 2014-03-06 14:30:03 +10:00
test-libevdev-has-event.c test: whitespace fixes (newlines) 2014-03-05 19:16:08 +10:00
test-libevdev-init.c test: whitespace fixes (newlines) 2014-03-05 19:16:08 +10:00
test-link.c test: add basic link test 2013-12-12 13:19:52 +10:00
test-main.c test: whitespace fixes (newlines) 2014-03-05 19:16:08 +10:00
test-uinput.c test: abort on unexpected log messages 2014-01-22 09:14:40 +10:00