Skip to content

Fix error handling in HID device probe functions

Guenter Roeck linux-hwmon 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v14 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4hwmon: (corsair-cpro) Stop device IO before calling hid_hw_stopdrivers/hwmon/corsair-cpro.c+1 -00 replies
2/4hwmon: (gigabyte_waterforce) Stop device IO before calling hid_hw_stopdrivers/hwmon/gigabyte_waterforce.c+3 -10 replies
3/4hwmon: (nzxt-smart2) Stop device IO before calling hid_hw_stopdrivers/hwmon/nzxt-smart2.c+1 -10 replies
4/4hwmon: (nzxt-kraken3) Stop device IO before calling hid_hw_stopdrivers/hwmon/nzxt-kraken3.c+4 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] Fix error handling in HID device probe functions

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 driver probe functions. 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() in affected hardware monitoring drivers.

v2: Call hid_device_io_stop() only if hid_device_io_start() has been called

----------------------------------------------------------------
Guenter Roeck (4):
hwmon: (corsair-cpro) Stop device IO before calling hid_hw_stop
hwmon: (gigabyte_waterforce) Stop device IO before calling hid_hw_stop
hwmon: (nzxt-smart2) Stop device IO before calling hid_hw_stop
hwmon: (nzxt-kraken3) Stop device IO before calling hid_hw_stop

 drivers/hwmon/corsair-cpro.c        | 1 +
 drivers/hwmon/gigabyte_waterforce.c | 4 +++-
 drivers/hwmon/nzxt-kraken3.c        | 6 ++++--
 drivers/hwmon/nzxt-smart2.c         | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)