diff options
| author | Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com> | 2026-10-15 22:13:18 +0700 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2026-11-20 14:59:25 +0100 |
| commit | ffadbae818a2f49551afba733d9f977b773ce6be (patch) | |
| tree | e7146eb4f5f3f0c13d610c6dc29e1dc801470828 /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | 92cbe1442b0980dcc96f2d1d71049a18b044cb51 (diff) | |
HID: saitek: don't dereference a NULL hidinput in saitek_event()
hid_process_event() calls the driver's ->event() for every usage of a
report, including fields that hidinput did not map to any input device,
e.g. a constant input item. For those fields field->hidinput is NULL,
and saitek_event() loads field->hidinput->input unconditionally:
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
RIP: 0010:saitek_event+0x51/0x2b0 drivers/hid/hid-saitek.c:154
hid_process_event drivers/hid/hid-core.c:1572
hid_report_raw_event drivers/hid/hid-core.c:2109
hid_input_report drivers/hid/hid-core.c:2180
hid_irq_in drivers/hid/usbhid/hid-core.c
A device that claims to be a Saitek MMO7 and uses such a descriptor
triggers it with a single input report.
Bail out early when the input side is not claimed or the field has no
input device, as the other HID drivers implementing ->event() do. The
claimed check also covers a failed hidinput_connect(), which frees the
hid_input structures without clearing field->hidinput.
Fixes: 37c492c8f6a9 ("HID: quirk for Saitek RAT7 and MMO7 mices' mode button")
Reported-by: syzbot+eba2b3201bd25a97cddf@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=eba2b3201bd25a97cddf
Cc: stable@vger.kernel.org
Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions
