]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
HID: magicmouse: Prevent out-of-bounds (OOB) read during DOUBLE_REPORT_ID
authorLee Jones <lee@kernel.org>
Thu, 16 Apr 2026 13:16:54 +0000 (14:16 +0100)
committerJiri Kosina <jkosina@suse.com>
Tue, 12 May 2026 15:49:18 +0000 (17:49 +0200)
commitd93ba918a185aca2594da63e92fdc5495b559c0f
treebb308586c17be917320e118dfb75be562a7e1917
parentf097d246677b03db814c5862f368cea341b76a00
HID: magicmouse: Prevent out-of-bounds (OOB) read during DOUBLE_REPORT_ID

It is currently possible for a malicious or misconfigured USB device to
cause an out-of-bounds (OOB) read when submitting reports using
DOUBLE_REPORT_ID by specifying a large report length and providing a
smaller one.

Let's prevent that by comparing the specified report length with the
actual size of the data read in from userspace.  If the actual data
length ends up being smaller than specified, we'll politely warn the
user and prevent any further processing.

Signed-off-by: Lee Jones <lee@kernel.org>
Reviewed-by: Günther Noack <gnoack@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-magicmouse.c