]> 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)
commit2c14dc36acee1793dd9beac6c74617b0609837c7
tree66100db26fb77704f9a1abb88aaddfc904a7f8e6
parent6afc47193e4777b99282905a7e7030535cdff92b
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