]> git.hungrycats.org Git - linux/commit
HID: logitech-dj: validate unnumbered keyboard reports
authorJiale Yao <yaojiale02@163.com>
Thu, 24 Sep 2026 14:44:08 +0000 (22:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2026 17:06:10 +0000 (12:06 -0500)
commitbf3e9e06e850c78673b373f3a6bb4baaf2949d66
treea50899ddae9cb5571d33d075c719a10c77922dfa
parent6a0a7d6418261e99e74ba7089b08889f1a93eafd
HID: logitech-dj: validate unnumbered keyboard reports

commit c2deafcb4c8227771f768d77ed3c0a489250e9b2 upstream.

The HID core invokes raw_event callbacks before validating the report
length.  For an unnumbered keyboard report, logi_dj_raw_event() uses the
second byte as temporary storage while prepending a report ID.  A one-byte
report therefore makes both the initial write and the later restoration
access data beyond the received report.

Reject unnumbered keyboard reports that do not provide the temporary byte.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init
sequence") added the same kind of raw_event length validation to hid-asus.

Fixes: 74808f9115ce ("HID: logitech-dj: add support for non unifying receivers")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-logitech-dj.c