]> git.baikalelectronics.ru Git - kernel.git/commit
HID: roccat: add bounds checking in kone_sysfs_write_settings()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 24 Aug 2020 08:57:35 +0000 (11:57 +0300)
committerJiri Kosina <jkosina@suse.cz>
Wed, 9 Sep 2020 06:35:15 +0000 (08:35 +0200)
commit6d3c8fb65388799c14b5890916407ad4c831e72c
tree09a6c5c7db6a4117f89a8b8fc4eefb886b2e612d
parentaa39fe622049b7e042cebb92a333a364c352e66c
HID: roccat: add bounds checking in kone_sysfs_write_settings()

This code doesn't check if "settings->startup_profile" is within bounds
and that could result in an out of bounds array access.  What the code
does do is it checks if the settings can be written to the firmware, so
it's possible that the firmware has a bounds check?  It's safer and
easier to verify when the bounds checking is done in the kernel.

Fixes: 4bdfe723a993 ("HID: add driver for Roccat Kone gaming mouse")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-roccat-kone.c