Skip to content
Snippets Groups Projects
Commit 813d47a4 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Todd Kjos
Browse files

Input: add safety guards to input_set_keycode()


commit cb222aed 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.

Reported-by: default avatar <syzbot+c769968809f9359b07aa@syzkaller.appspotmail.com>
Reported-by: default avatar <syzbot+76f3a30e88d256644c78@syzkaller.appspotmail.com>
Link: https://lore.kernel.org/r/20191207212757.GA245964@dtor-ws


Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 784243c2
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment