From: Guenter Roeck <linux@roeck-us.net>
To: Hardware Monitoring <linux-hwmon@vger.kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 2/4] hwmon: (gigabyte_waterforce) Stop device IO before calling hid_hw_stop
Date: Tue, 7 Jul 2026 18:58:04 -0700 [thread overview]
Message-ID: <20260708015806.213790-3-linux@roeck-us.net> (raw)
In-Reply-To: <20260708015806.213790-1-linux@roeck-us.net>
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 <sashiko-bot@kernel.org>
Fixes: 42ac68e3d4ba0 ("hwmon: Add driver for Gigabyte AORUS Waterforce AIO coolers")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/gigabyte_waterforce.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hwmon/gigabyte_waterforce.c b/drivers/hwmon/gigabyte_waterforce.c
index 27487e215bdd..d5b27751147b 100644
--- a/drivers/hwmon/gigabyte_waterforce.c
+++ b/drivers/hwmon/gigabyte_waterforce.c
@@ -381,6 +381,7 @@ static int waterforce_probe(struct hid_device *hdev, const struct hid_device_id
fail_and_close:
hid_hw_close(hdev);
fail_and_stop:
+ hid_device_io_stop(hdev);
hid_hw_stop(hdev);
return ret;
}
--
2.45.2
next prev parent reply other threads:[~2026-07-08 1:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 1:58 [PATCH 0/4] Fix error handling in HID device probe functions Guenter Roeck
2026-07-08 1:58 ` [PATCH 1/4] hwmon: (corsair-cpro) Stop device IO before calling hid_hw_stop Guenter Roeck
2026-07-08 2:09 ` sashiko-bot
2026-07-08 1:58 ` Guenter Roeck [this message]
2026-07-08 2:08 ` [PATCH 2/4] hwmon: (gigabyte_waterforce) " sashiko-bot
2026-07-08 1:58 ` [PATCH 3/4] hwmon: (nzxt-smart2) " Guenter Roeck
2026-07-08 2:11 ` sashiko-bot
2026-07-08 1:58 ` [PATCH 4/4] hwmon: (nzxt-kraken3) " Guenter Roeck
2026-07-08 2:10 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260708015806.213790-3-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-hwmon@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.