]> git.ipfire.org Git - people/arne_f/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:49 +0000 (10:19 +0200)
commit62928cce6e76e91e8fd8c82c52db0b04b12ece61
tree93d5814402b54a66152c76e1c80de9a7229df393
parent1e21d43f1c3be8cc0a8b149ee843441536e5f3d3
HID: steam: fixes race in handling device list.

[ Upstream commit 2d3f53a80e4eed078669853a178ed96d88f74143 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-steam.c