diff options
| author | YuanZhe Liu <25031212351@stu.xidian.edu.cn> | 2026-10-28 15:41:43 +0800 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-10-31 16:41:07 +0100 |
| commit | 820e0050866942b5498488496462d12c6ce1c7a9 (patch) | |
| tree | 1be9021ff4566fb8069c7e3debce5d11e24db080 /scripts/stackusage | |
| parent | f5d3eb483fed59fc0f3b059b8b6a32cedc922360 (diff) | |
ALSA: us122l: Fix NULL dereference at hwdep open and release
usb_stream_hwdep_open() and usb_stream_hwdep_release() pass the result of
usb_ifnum_to_if() straight to usb_autopm_get_interface() and
usb_autopm_put_interface(), without checking it for NULL.
usb_ifnum_to_if() returns NULL once the device is gone, since
usb_disable_device() clears udev->actconfig on disconnect. The hwdep file
can outlive the disconnect: the card is released with
snd_card_free_when_closed(), so a process that keeps the character device
open reaches the driver's release callback after the USB configuration has
been dropped, and interface_to_usbdev() then dereferences the NULL
interface at offsetof(struct device, parent). The open callback has the
same problem when it races with the disconnect.
Check both lookups and fail the open with -ENODEV; in release, skip the
runtime PM put when the interface is already gone and still run the rest
of the per-file cleanup. Move the us122l->first bookkeeping after the
checks so that a failed open no longer leaves a stale file pointer behind.
Fixes: 030a07e44129 ("ALSA: Add USB US122L driver")
Cc: stable@vger.kernel.org
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Link: https://patch.msgid.link/20261028074143.14440-1-25031212351@stu.xidian.edu.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
