From: sashiko-bot@kernel.org
To: "Miguel Garcia" <miguelgarciaroman8@gmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH 6.6.y] Input: aiptek - validate raw macro indices before updating state
Date: Mon, 07 Sep 2026 19:02:59 +0000 [thread overview]
Message-ID: <20260907190300.6B40E1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907185001.1567957-1-miguelgarciaroman8@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Unbounded user input in sysfs 'delay' attribute allows arbitrary uninterruptible sleep, hanging USB unbind and device hotplug.
--
commit ba9154b0332977963ad5bed995346ca93b2e47dc
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>
Input: aiptek - validate raw macro indices before updating state
This commit adds bounds checking for raw macro key indices derived from
tablet reports before updating the state in the driver. It ensures the
index does not exceed the macroKeyEvents array bounds to prevent out of
bounds access.
Link: https://patch.msgid.link/20260329001711.88076-1-pengpeng@iscas.ac.cn
> diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
> index baabc51547b83..6210cd99d6291 100644
> --- a/drivers/input/tablet/aiptek.c
> +++ b/drivers/input/tablet/aiptek.c
[ ... ]
[Severity: High]
This is a pre-existing issue, and was not introduced by the patch under
review, but while reviewing this file I noticed unbounded user input in the
sysfs delay attribute allows an arbitrary uninterruptible sleep.
In drivers/input/tablet/aiptek.c:store_tabletProgrammableDelay():
err = kstrtoint(buf, 10, &d);
if (err)
return err;
aiptek->newSetting.programmableDelay = d;
User input is parsed into an integer and stored without bounds checking.
When the execute attribute is subsequently written, this value is used
in aiptek_query():
msleep(aiptek->curSetting.programmableDelay);
Can this cause a task to block indefinitely in TASK_UNINTERRUPTIBLE?
If a user writes a huge positive or negative integer to the delay sysfs
attribute, the unbounded value is passed to msleep(). While holding a sysfs
active reference, this prevents the sysfs node from being removed.
If this is triggered and the USB device is subsequently disconnected, does
this force the kernel's USB hub event thread to hang indefinitely in
kernfs_drain()? This would deadlock the USB hub and prevent further device
enumeration or disconnection.
Should this sysfs input be clamped to a safe maximum value before being
stored in programmableDelay?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907185001.1567957-1-miguelgarciaroman8@gmail.com?part=1
next prev parent reply other threads:[~2026-09-07 19:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 18:50 [PATCH 6.6.y] Input: aiptek - validate raw macro indices before updating state Miguel Garcia
2026-09-07 19:02 ` sashiko-bot [this message]
2026-09-08 10:51 ` Greg KH
2026-09-09 10:28 ` Miguel García Román
2026-09-09 10:29 ` [PATCH 6.12.y] " Miguel García Román
2026-09-09 10:51 ` sashiko-bot
2026-09-09 10:29 ` [PATCH 6.18.y] " Miguel García Román
2026-09-08 22:39 ` [PATCH 6.6.y] " Sasha Levin
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=20260907190300.6B40E1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=miguelgarciaroman8@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox