]> 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)
commit04504917edd03ce091d5fd0a63980be4b2957c58
tree09a6c5c7db6a4117f89a8b8fc4eefb886b2e612d
parent7358fd2f7f19f59020193385802e679a31c01918
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