]> git.baikalelectronics.ru Git - kernel.git/commit
HID: steam: fixes race in handling device list.
authorRodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Tue, 16 Jun 2020 16:44:18 +0000 (18:44 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 19 Jun 2020 07:21:21 +0000 (09:21 +0200)
commit55700e6546f6da0734eb4c2350bcdf877c4c0833
tree66100db26fb77704f9a1abb88aaddfc904a7f8e6
parent7224e96e146bcb03a71e28400bac00219e97c827
HID: steam: fixes race in handling device list.

Using uhid and KASAN this driver crashed because it was getting
several connection events where it only expected one. Then the
device was added several times to the static device list and it got
corrupted.

This patch checks if the device is already in the list before adding
it.

Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Tested-by: Siarhei Vishniakou <svv@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-steam.c