From: sashiko-bot@kernel.org
To: "Yifan Zhang" <yfzhang23@stu.pku.edu.cn>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] HID: pidff: validate effect type usage indexes
Date: Mon, 02 Nov 2026 12:02:07 +0000 [thread overview]
Message-ID: <sashiko-outbox-193362@kernel.org> (raw)
In-Reply-To: <179362071771.29269.11607321878213733518@stu.pku.edu.cn>
> pidff_find_special_keys() records usage positions as one-based values, but
> pidff_find_effects() uses those values directly as array indexes. The
> Create New Effect and Set Effect fields are independently allocated and
> need not have the same number of usages, so a malformed descriptor can
> make the lookup leave the Set Effect usage array.
>
> KASAN reports:
>
> BUG: KASAN: slab-out-of-bounds in hid_pidff_init_with_quirks
> Read of size 4
> hid_pidff_init_with_quirks
> universal_pidff_probe
> hid_device_probe
> uhid_device_add_worker
>
> Convert the stored position back to a zero-based index and validate it
> against both fields before comparing the usages.
>
> The reproducer is rejected without a KASAN report with this change.
>
> Fixes: 224ee88fe395 ("Input: add force feedback driver for PID devices")
> Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/179362071771.29269.11607321878213733518@stu.pku.edu.cn?part=1
prev parent reply other threads:[~2026-11-02 12:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 11:58 [PATCH] HID: pidff: validate effect type usage indexes Yifan Zhang
2026-11-02 11:58 ` Yifan Zhang
2026-11-02 12:02 ` sashiko-bot [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=sashiko-outbox-193362@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yfzhang23@stu.pku.edu.cn \
/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