All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arie Miller" <renari@arimil.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v2 3/4] hwmon: (asus_rog_ryujin) Add ROG Ryujin III White Edition
Date: Tue, 11 Aug 2026 23:51:26 +0000	[thread overview]
Message-ID: <20260811235127.3A56C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260811233943.319729-4-renari@arimil.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Missing bounds check on incoming HID report size in `rog_ryujin_raw_event` leading to an out-of-bounds heap read.
--

--- Patch [3]: [PATCH v2 3/4] hwmon: (asus_rog_ryujin) Add ROG Ryujin III White Edition ---
commit b585240116bcd8eafe7d693a9003f8ad82dee763
Author: Will Smith <github@notthatwillsmith.com>

hwmon: (asus_rog_ryujin) Add ROG Ryujin III White Edition

The ROG Ryujin III White Edition uses the same report layout as the
other supported Ryujin III variants. Add its USB device ID and list it
in the driver documentation.

Link: https://github.com/aleksamagicka/asus_rog_ryujin-hwmon/pull/10

> diff --git a/drivers/hwmon/asus_rog_ryujin.c b/drivers/hwmon/asus_rog_ryujin.c
> index 5bc60c6036de3..9b34c6e06bf78 100644
> --- a/drivers/hwmon/asus_rog_ryujin.c
> +++ b/drivers/hwmon/asus_rog_ryujin.c

[ ... ]

> @@ -587,6 +588,8 @@ static const struct hid_device_id rog_ryujin_table[] = {
>  	  .driver_data = (kernel_ulong_t)&rog_ryujin_iii_info },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUS_ROG, USB_PRODUCT_ID_RYUJIN_III_EVA),
>  	  .driver_data = (kernel_ulong_t)&rog_ryujin_iii_info },
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUS_ROG, USB_PRODUCT_ID_RYUJIN_III_WHITE),
> +	  .driver_data = (kernel_ulong_t)&rog_ryujin_iii_info },

[Severity: High]
This is a pre-existing issue, but adding this device ID exposes the new
hardware to a missing bounds check in rog_ryujin_raw_event().

When the driver receives raw HID reports, it fails to validate the incoming
size parameter against the offsets it accesses:

drivers/hwmon/asus_rog_ryujin.c:rog_ryujin_raw_event() {
	...
	if (data[0] != RYUJIN_CMD_PREFIX)
		return 0;

	if (data[1] == RYUJIN_GET_COOLER_STATUS_CMD_RESPONSE) {
		/* Received coolant temp and speeds of pump and internal fan */
		priv->temp_input[0] = data[priv->info->temp_offset] * 1000 +
			data[priv->info->temp_offset + 1] * 100;
	...
}

If a malicious USB device presents a HID descriptor declaring a very small
report size (e.g., 1 byte) and sends a 1-byte report, the driver
unconditionally accesses fixed offsets such as data[1] and, depending on the
device info, up to data[12].

Could this allow an out-of-bounds heap read where leaked kernel memory is
stored in variables like priv->temp_input and priv->speed_input, and then
exposed to userspace via the hwmon sysfs interface?

>  	{ }
>  };
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260811233943.319729-1-renari@arimil.com?part=3

  reply	other threads:[~2026-08-11 23:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 23:39 [PATCH v2 0/4] hwmon: Add ASUS ROG Ryujin III support Arie Miller
2026-08-11 23:39 ` [PATCH v2 1/4] hwmon: (asus_rog_ryujin) Add per-device configuration Arie Miller
2026-08-11 23:49   ` sashiko-bot
2026-08-11 23:39 ` [PATCH v2 2/4] hwmon: (asus_rog_ryujin) Add ROG Ryujin III support Arie Miller
2026-08-11 23:52   ` sashiko-bot
2026-08-11 23:39 ` [PATCH v2 3/4] hwmon: (asus_rog_ryujin) Add ROG Ryujin III White Edition Arie Miller
2026-08-11 23:51   ` sashiko-bot [this message]
2026-08-11 23:39 ` [PATCH v2 4/4] hwmon: (asus_rog_ryujin) Handle missing driver data Arie Miller
2026-08-11 23:51   ` sashiko-bot
2026-08-12  2:00   ` Guenter Roeck

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=20260811235127.3A56C1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=renari@arimil.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.