All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Eliav Farber" <farbere@amazon.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH v5 07/13] Input: adp5585: use devm_blocking_notifier_chain_register()
Date: Sun, 16 Aug 2026 06:14:33 +0000	[thread overview]
Message-ID: <20260816061434.272E61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260816060648.4030-8-farbere@amazon.com>

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

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but there is a potential NULL pointer dereference due to an unchecked `platform_get_device_id()` return value.
--

--- Patch [7]: [PATCH v5 07/13] Input: adp5585: use devm_blocking_notifier_chain_register() ---
commit 7fdada2980ba610dca31ca2b97c993a21524a85f
Author: Eliav Farber <farbere@amazon.com>

Input: adp5585: use devm_blocking_notifier_chain_register()

This commit replaces the manual registration and devm cleanup of the
blocking notifier chain with a single call to
devm_blocking_notifier_chain_register().

> diff --git a/drivers/input/keyboard/adp5585-keys.c b/drivers/input/keyboard/adp5585-keys.c
> index 4208229e13561..012558237674e 100644
> --- a/drivers/input/keyboard/adp5585-keys.c
> +++ b/drivers/input/keyboard/adp5585-keys.c
[ ... ]
>  static int adp5585_keys_probe(struct platform_device *pdev)
>  {
>  	const struct platform_device_id *id = platform_get_device_id(pdev);

[Severity: High]
This isn't a bug introduced by this patch, but is it possible for
platform_get_device_id() to return a null pointer here and cause a panic
when id->driver_data is dereferenced?

Looking at adp5585_keys_probe(), the returned id is not checked before
accessing id->driver_data:

drivers/input/keyboard/adp5585-keys.c:adp5585_keys_probe() {
        const struct platform_device_id *id = platform_get_device_id(pdev);
        ...
        kpad->info = (const struct adp5585_kpad_chip *)id->driver_data;
}

If a privileged user writes an arbitrary string to the driver_override
sysfs attribute of a platform device and binds it to this driver,
platform_get_device_id() will return null because the bound device
name doesn't match the driver's id_table. Does this code need a null
pointer check to prevent a local denial of service?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260816060648.4030-1-farbere@amazon.com?part=7

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

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16  6:05 [PATCH v5 00/13] notifier: add device-managed registration APIs and convert drivers Eliav Farber
2026-08-16  6:06 ` [PATCH v5 01/13] notifier: add device-managed registration APIs Eliav Farber
2026-08-16  6:19   ` sashiko-bot
2026-08-16  7:00     ` Uwe Kleine-König
2026-08-16  7:04   ` Uwe Kleine-König
2026-08-16  6:06 ` [PATCH v5 02/13] pwm: iqs620a: use devm_blocking_notifier_chain_register() Eliav Farber
2026-08-16  6:06 ` [PATCH v5 03/13] iio: light: iqs621-als: " Eliav Farber
2026-08-16  6:06 ` [PATCH v5 04/13] iio: position: iqs624: " Eliav Farber
2026-08-16  6:06 ` [PATCH v5 05/13] gpio: adp5585: " Eliav Farber
2026-08-16  6:14   ` sashiko-bot
2026-08-16  6:06 ` [PATCH v5 06/13] platform/x86: bitland-mifs-wmi: " Eliav Farber
2026-08-16  6:06 ` [PATCH v5 07/13] Input: adp5585: " Eliav Farber
2026-08-16  6:14   ` sashiko-bot [this message]
2026-08-16  6:06 ` [PATCH v5 08/13] ACPI: APEI: GHES: remove unused ghes_{,un}register_vendor_record_notifier() Eliav Farber
2026-08-16  6:06 ` [PATCH v5 09/13] ACPI: APEI: GHES: use devm_blocking_notifier_chain_register() Eliav Farber
2026-08-16  6:06 ` [PATCH v5 10/13] platform/x86: uniwill-wmi: " Eliav Farber
2026-08-16  6:06 ` [PATCH v5 11/13] gpio: eic-sprd: use devm_atomic_notifier_chain_register() Eliav Farber
2026-08-16  6:06 ` [PATCH v5 12/13] gpio: gpiolib-kunit: use devm_blocking_notifier_chain_register() Eliav Farber
2026-08-16  6:06 ` [PATCH v5 13/13] reboot: " Eliav Farber

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=20260816061434.272E61F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=farbere@amazon.com \
    --cc=linux-input@vger.kernel.org \
    --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.