2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-07 21:24:00 +08:00
linux-next/drivers/hid/usbhid
Gustavo A. R. Silva 4f65245f2d HID: hiddev: fix potential Spectre v1
uref->field_index, uref->usage_index, finfo.field_index and cinfo.index can be
indirectly controlled by user-space, hence leading to a potential exploitation
of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

drivers/hid/usbhid/hiddev.c:473 hiddev_ioctl_usage() warn: potential spectre issue 'report->field' (local cap)
drivers/hid/usbhid/hiddev.c:477 hiddev_ioctl_usage() warn: potential spectre issue 'field->usage' (local cap)
drivers/hid/usbhid/hiddev.c:757 hiddev_ioctl() warn: potential spectre issue 'report->field' (local cap)
drivers/hid/usbhid/hiddev.c:801 hiddev_ioctl() warn: potential spectre issue 'hid->collection' (local cap)

Fix this by sanitizing such structure fields before using them to index
report->field, field->usage and hid->collection

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-09 14:31:14 +02:00
..
hid-core.c HID: usbhid: extend the polling interval configuration to keyboards 2018-03-23 14:48:37 +01:00
hid-pidff.c HID: pidff: effect can't be NULL 2015-03-27 16:03:26 +01:00
hiddev.c HID: hiddev: fix potential Spectre v1 2018-07-09 14:31:14 +02:00
Kconfig HID: Fix the generic Kconfig options 2012-06-25 17:25:00 +02:00
Makefile HID: core: move the dynamic quirks handling in core 2017-11-21 11:14:48 +01:00
usbhid.h HID: usbhid: do not rely on hid->open when deciding to do IO 2017-06-08 13:56:09 +02:00
usbkbd.c HID: usbkbd: constify usb_device_id and fix space before '[' error. 2017-08-10 11:07:49 +02:00
usbmouse.c HID: usbmouse: constify usb_device_id and fix space before '[' error 2017-08-10 11:07:49 +02:00