]> git.baikalelectronics.ru Git - kernel.git/commit
Input: uinput - fix crash when mixing old and new init style
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 31 Jan 2017 22:56:43 +0000 (14:56 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 1 Feb 2017 18:33:11 +0000 (10:33 -0800)
commitd71fa1c1adb30b2865b022f7f6934b90834ebd6b
tree651342ba16b904180f0953e2eb989afed3e9b5e8
parent30439b19b4c0bd4376ea6bf40a03ad681e15973c
Input: uinput - fix crash when mixing old and new init style

If user tries to initialize uinput device mixing old and new style
initialization (i.e. using old UI_SET_ABSBIT instead of UI_ABS_SETUP,
we forget to allocate input->absinfo and will crash when trying to send
absolute events:

        ioctl(ui, UI_DEV_SETUP, &us);
        ioctl(ui, UI_SET_PHYS, "Test");

        ioctl(ui, UI_SET_EVBIT, EV_ABS);
        ioctl(ui, UI_SET_ABSBIT, ABS_X);
        ioctl(ui, UI_SET_ABSBIT, ABS_Y);
        ioctl(ui, UI_DEV_CREATE, 0);

Reported-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=191811
Fixes: 877075365962 ("Input: uinput - rework ABS validation")
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/uinput.c