diff options
| author | Sanman Pradhan <psanman@juniper.net> | 2026-04-10 00:25:35 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-04-22 13:32:22 +0200 |
| commit | 61f2aa23b0ce8d7aa5071ed25a7471e246a4fdd4 (patch) | |
| tree | 2e377a9a6321263b1cacaef86cf24b1489d34519 /scripts/stackusage | |
| parent | dd2b888e08d3b3d6aacd65d76cd44fac11da750f (diff) | |
| download | kernel-61f2aa23b0ce8d7aa5071ed25a7471e246a4fdd4.tar.gz | |
hwmon: (powerz) Fix use-after-free on USB disconnect
commit 08e57f5e1a9067d5fbf33993aa7f51d60b3d13a4 upstream.
After powerz_disconnect() frees the URB and releases the mutex, a
subsequent powerz_read() call can acquire the mutex and call
powerz_read_data(), which dereferences the freed URB pointer.
Fix by:
- Setting priv->urb to NULL in powerz_disconnect() so that
powerz_read_data() can detect the disconnected state.
- Adding a !priv->urb check at the start of powerz_read_data()
to return -ENODEV on a disconnected device.
- Moving usb_set_intfdata() before hwmon registration so the
disconnect handler can always find the priv pointer.
Fixes: 4381a36abdf1c ("hwmon: add POWER-Z driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sanman Pradhan <psanman@juniper.net>
Link: https://lore.kernel.org/r/20260410002521.422645-2-sanman.pradhan@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
