Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: k8ie <k8ie@mcld.eu>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v2] HID: playstation: Support DualSense player LED brightness control
Date: Tue, 14 Jul 2026 19:18:42 +0000	[thread overview]
Message-ID: <20260714191842.870431F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260714184225.84646-1-k8ie@mcld.eu>

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

Pre-existing issues:
- [Critical] Missing cancel_work_sync() in the probe error paths of dualsense_create() and dualshock4_create() causes a use-after-free vulnerability.
--

--- Patch [1]: [PATCH v2] HID: playstation: Support DualSense player LED brightness control ---
commit c4af8f1ee7d50867512c691be4fbde7636ea1510
Author: Kateřina Medvědová <k8ie@mcld.eu>

HID: playstation: Support DualSense player LED brightness control

This patch wires up the controls for the brightness byte on the DualSense
player indicator LEDs. It increases the max_brightness of each player's LED
classdev from 1 to 3, and updates the brightness values before sending
the output reports.

> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index f9dc9378cf777..58786117ec016 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
[ ... ]
> @@ -1742,15 +1776,15 @@ static struct ps_device *dualsense_create(struct hid_device *hdev)
>  	int i, ret;
>  
>  	static const struct ps_led_info player_leds_info[] = {
> -		{ LED_FUNCTION_PLAYER1, "white", 1, dualsense_player_led_get_brightness,
> +		{ LED_FUNCTION_PLAYER1, "white", 3, dualsense_player_led_get_brightness,
>  				dualsense_player_led_set_brightness },
> -		{ LED_FUNCTION_PLAYER2, "white", 1, dualsense_player_led_get_brightness,
> +		{ LED_FUNCTION_PLAYER2, "white", 3, dualsense_player_led_get_brightness,
>  				dualsense_player_led_set_brightness },

[Severity: Critical]
This is a pre-existing issue, but the error paths for dualsense_create() and
dualshock4_create() appear to be missing a cancel_work_sync() call.

If initialization fails after the work is scheduled (for example, if
ps_led_register() fails in dualsense_create()), the code jumps to the err
path:

drivers/hid/hid-playstation.c:dualsense_create() {
    ...
err:
	ps_devices_list_remove(ps_dev);
	return ERR_PTR(ret);
}

Since ds->output_worker is not canceled before the devm routines free the
ds/ds4 structure, could this result in a use-after-free when the global
workqueue eventually executes the worker function?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260714184225.84646-1-k8ie@mcld.eu?part=1

      reply	other threads:[~2026-07-14 19:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 18:04 [PATCH] HID: playstation: Support DualSense player LED brightness control Kateřina Medvědová
2026-07-14 18:25 ` sashiko-bot
2026-07-14 18:42 ` [PATCH v2] " k8ie
2026-07-14 19:18   ` 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=20260714191842.870431F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=k8ie@mcld.eu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox