mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
hwmon: (nzxt-smart2) Stop device IO before calling hid_hw_stop
Calling hid_hw_stop() does not stop the device IO.
This results in a race condition between hid_input_report() and the point
immediately following the execution of hid_device_io_start() within
the driver probe function. If the probe operation fails after "io start"
has been initiated, this race condition will result in a UAF vulnerability.
Fix the problem by calling hid_device_io_stop() before calling
hid_hw_stop().
Reported-by: Sashiko <[email protected]>
Fixes: 53e68c20ae ("hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2")
Signed-off-by: Guenter Roeck <[email protected]>
This commit is contained in:
1 parent
ff0c5c53d0
commit
59d104b54b
1 file changed
+1
-1
@@ -768,7 +768,7 @@ static int nzxt_smart2_hid_probe(struct hid_device *hdev,
|
||||
|
||||
out_hw_close:
|
||||
hid_hw_close(hdev);
|
||||
|
||||
hid_device_io_stop(hdev);
|
||||
out_hw_stop:
|
||||
hid_hw_stop(hdev);
|
||||
return ret;
|
||||
|
||||
Reference in new issue
Block a user