Files
linux/drivers/input/input.c
Dmitry Torokhov 9f1db5e0fe Input: add safety guards to input_set_keycode() (CVE-2019-20636)
PD#SWPL-29181

commit cb222aed03 upstream

If we happen to have a garbage in input device's keycode table with values
too big we'll end up doing clear_bit() with offset way outside of our
bitmaps, damaging other objects within an input device or even outside of
it. Let's add sanity checks to the returned old keycodes.

Change-Id: I9c376dc61b1e81f3c538f472c1031a74d3c81331
Reported-by: syzbot+c769968809f9359b07aa@syzkaller.appspotmail.com
Reported-by: syzbot+76f3a30e88d256644c78@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20191207212757.GA245964@dtor-ws
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
2020-12-17 17:32:09 +09:00

60 KiB