Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tristan Madani" <tristmd@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v2] HID: intel-thc-hid: validate ACPI buffer length before memcpy
Date: Sun, 25 Oct 2026 15:57:27 +0000	[thread overview]
Message-ID: <sashiko-outbox-184268@kernel.org> (raw)
In-Reply-To: <20261025154745.2734805-1-tristmd@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] HID: intel-thc-hid: missing @buf_size kernel-doc in ACPI helpers
--

commit 43947a3c4aa80586265415752a6a772f3e74da02
Author: Tristan Madani <tristan@talencesecurity.com>

HID: intel-thc-hid: validate ACPI buffer length before memcpy

This commit adds a buf_size parameter to the QuickI2C and QuickSPI ACPI
helper functions to validate returned buffer lengths before copying them into
destination structures. It also adds missing ACPI object type validation and
memory cleanup in quicki2c_acpi_get_dsd_property(), and zero-initializes the
caller stack structures.

> diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
> index 7a913f717efaa..dd21864d16b05 100644
> --- a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
> +++ b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
> @@ -62,7 +62,8 @@ static const struct acpi_gpio_mapping quicki2c_gpios[] = {
>   * Return: 0 if success or ENODEV on failure.
>   */
>  static int quicki2c_acpi_get_dsm_property(struct acpi_device *adev, const guid_t *guid,
> -					  u64 rev, u64 func, acpi_object_type type, void *prop_buf)
> +					  u64 rev, u64 func, acpi_object_type type,
> +					  void *prop_buf, size_t buf_size)
>  {

[ ... ]

> @@ -97,7 +103,8 @@ static int quicki2c_acpi_get_dsm_property(struct acpi_device *adev, const guid_t
>   * Return: 0 if success or ENODEV on failed.
>   */
>  static int quicki2c_acpi_get_dsd_property(struct acpi_device *adev, acpi_string dsd_method_name,
> -					  acpi_object_type type, void *prop_buf)
> +					  acpi_object_type type, void *prop_buf,
> +					  size_t buf_size)
>  {

[ ... ]

> diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> index 53023e30cf8d4..e4331ba4e503d 100644
> --- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> +++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> @@ -81,7 +81,8 @@ static const struct acpi_gpio_mapping quickspi_gpios[] = {
>   * Return: 0 if successful or ENODEV on failed.
>   */
>  static int thc_acpi_get_property(struct acpi_device *adev, const guid_t *guid,
> -				 u64 rev, u64 func, acpi_object_type type, void *prop_buf)
> +				 u64 rev, u64 func, acpi_object_type type,
> +				 void *prop_buf, size_t buf_size)
>  {

[Severity: Low]
Should the kernel-doc comments above quicki2c_acpi_get_dsm_property() and
quicki2c_acpi_get_dsd_property() in
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c, as well as
thc_acpi_get_property() in
drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c, be updated to
describe the new @buf_size parameter?

Without @buf_size in those kernel-doc blocks, building with W=1 or running
scripts/kernel-doc triggers warnings that the function parameter buf_size is
not described.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261025154745.2734805-1-tristmd@gmail.com?part=1

  reply	other threads:[~2026-10-25 15:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24 20:58 [PATCH] HID: intel-thc-hid: validate ACPI buffer length before use Tristan Madani
2026-10-24 21:35 ` sashiko-bot
2026-10-25 10:49 ` kernel test robot
2026-10-25 15:47 ` [PATCH v2] HID: intel-thc-hid: validate ACPI buffer length before memcpy Tristan Madani
2026-10-25 15:57   ` sashiko-bot [this message]
2026-10-26  2:02   ` Xu, Even
2026-10-25 21:40 ` [PATCH v3] " Tristan Madani

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-184268@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tristmd@gmail.com \
    /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