Re: [PATCH v2] HID: playstation: Support DualSense player LED brightness control
From: sashiko-bot@kernel.org
Date: 2026-07-14 19:18:42
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á [off-list ref] 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.
quoted hunk ↗ jump to hunk
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
[ ... ]
quoted hunk ↗ jump to hunk
@@ -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