]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
HID: logitech-dj: Prevent REPORT_ID_DJ_SHORT related user initiated OOB write
authorLee Jones <lee@kernel.org>
Tue, 24 Mar 2026 14:36:44 +0000 (14:36 +0000)
committerJiri Kosina <jkosina@suse.com>
Thu, 9 Apr 2026 15:35:52 +0000 (17:35 +0200)
commitb6a57912854e7ea36f3b270032661140cc4209cd
tree20d83564b7c82a5815e6a8ad487b61e3bbff39bb
parenta940aee176437046598dfc786b719bd96db3c74c
HID: logitech-dj: Prevent REPORT_ID_DJ_SHORT related user initiated OOB write

logi_dj_recv_send_report() assumes that all incoming REPORT_ID_DJ_SHORT
reports are 14 Bytes (DJREPORT_SHORT_LENGTH - 1) long.  It uses that
assumption to load the associated field's 'value' array with 14 Bytes of
data.  However, if a malicious user only sends say 1 Byte of data,
'report_count' will be 1 and only 1 Byte of memory will be allocated to
the 'value' Byte array.  When we come to populate 'value[1-13]' we will
experience an OOB write.

Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-logitech-dj.c