All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Benato <denis.benato@linux.dev>
To: Panz Dev <panz.development@gmail.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] HID: asus: do not send keyboard init reports to touchpads
Date: Wed, 19 Aug 2026 16:16:24 +0200	[thread overview]
Message-ID: <6627d99d-5507-49d0-bdea-f14c919a290d@linux.dev> (raw)
In-Reply-To: <20260818151431.939132-1-panz.development@gmail.com>


On 8/18/26 17:14, Panz Dev wrote:
> Commit 0919db9f3583 ("HID: asus: always fully initialize devices") added a
> loop during asus_probe() to send keyboard feature report initializations
> (asus_kbd_init) to all ASUS HID devices.
>
> On ASUS laptops with I2C/HID touchpads (such as the ASUS E200HA), sending
> keyboard feature reports (FEATURE_KBD_REPORT_ID) to touchpad endpoints
> sends invalid feature requests to touchpad hardware, corrupting probe
> state and causing the touchpad to become unresponsive.
>
> Wrap the asus_report_id_init loop in an `if (!drvdata->tp)` check so
> keyboard feature initialization only runs for actual keyboards.
>
> Tested on ASUS E200HA (where touchpad functionality is fully restored)
> and ASUS VivoBook Flip 14 TP401MA (confirming zero regressions).
>
> Fixes: 0919db9f3583 ("HID: asus: always fully initialize devices")
> Cc: stable@vger.kernel.org

Reviewed-by: Denis Benato <denis.benato@linux.dev>
> Signed-off-by: Panz Dev <panz.development@gmail.com>
> ---
> v2:
>  - Keep asus_start_multitouch() inside the HID_CLAIMED_INPUT check to avoid
>    any UAF risk if input registration fails (as pointed out by Denis Benato
>    and automated review).
>  - Focus the fix on skipping keyboard report initialization for touchpads.
> ---
>  drivers/hid/hid-asus.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 3f5e96900b67..7f19ca1e5a1b 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -1294,12 +1294,14 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
>  		return ret;
>  	}
>
> -	for (int r = 0; r < ARRAY_SIZE(asus_report_id_init); r++) {
> -		if (asus_has_report_id(hdev, asus_report_id_init[r])) {
> -			ret = asus_kbd_init(hdev, asus_report_id_init[r]);
> -			if (ret < 0)
> -				hid_warn(hdev, "Failed to initialize 0x%x: %d.\n",
> -					 asus_report_id_init[r], ret);
> +	if (!drvdata->tp) {
> +		for (int r = 0; r < ARRAY_SIZE(asus_report_id_init); r++) {
> +			if (asus_has_report_id(hdev, asus_report_id_init[r])) {
> +				ret = asus_kbd_init(hdev, asus_report_id_init[r]);
> +				if (ret < 0)
> +					hid_warn(hdev, "Failed to initialize 0x%x: %d.\n",
> +						 asus_report_id_init[r], ret);
> +			}
>  		}
>  	}
>

      parent reply	other threads:[~2026-08-19 14:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 15:14 [PATCH v2] HID: asus: do not send keyboard init reports to touchpads Panz Dev
2026-08-18 15:29 ` sashiko-bot
2026-08-19 14:16 ` Denis Benato [this message]

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=6627d99d-5507-49d0-bdea-f14c919a290d@linux.dev \
    --to=denis.benato@linux.dev \
    --cc=bentiss@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=panz.development@gmail.com \
    --cc=stable@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.