diff options
| author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2018-06-29 17:08:44 -0500 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2019-05-02 15:56:43 +0200 |
| commit | 14de4b6a991e109c235c5915f9a8d88266af0f00 (patch) | |
| tree | 1268537ac36b051172f54191abfe14cf908d0d75 /scripts/basic | |
| parent | 3f8d05cad6be7f3f3b4811eb8e44624db15de68b (diff) | |
HID: hiddev: fix potential Spectre v1
commit 4f65245f2d178b9cba48350620d76faa4a098841 upstream.
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
Change-Id: Iaf59ae8d06c17da1240eec8e3b558ba41592cc05
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions
