CVE-2026-99315: ALSA: us122l: Fix NULL dereference at hwdep open and release
In the Linux kernel, the following vulnerability has been resolved:
ALSA: us122l: Fix NULL dereference at hwdep open and release
usbstreamhwdepopen() and usbstreamhwdeprelease() pass the result of usbifnumtoif() straight to usbautopmgetinterface() and usbautopmputinterface(), without checking it for NULL.
usbifnumtoif() returns NULL once the device is gone, since usbdisabledevice() clears udev->actconfig on disconnect. The hwdep file can outlive the disconnect: the card is released with sndcardfreewhenclosed(), so a process that keeps the character device open reaches the driver's release callback after the USB configuration has been dropped, and interfacetousbdev() 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the us122l hwdep open and release callbacks, check both interface lookups; fail open with -ENODEV if a lookup returns NULL, and in release skip usb_autopm_put_interface() when the interface is gone while still running the remaining per-file cleanup. Move us122l->first bookkeeping after the checks so a failed open does not leave a stale file pointer.
Event History
Frequently Asked Questions
Which systems are exposed to this failure?
Systems using the Linux kernel's ALSA us122l driver are affected when the associated USB device disconnects while hardware-dependent device operations are still in progress or retained by a process.
What condition triggers the NULL dereference?
The failure occurs when an open operation races with USB-device disconnect, or when a process keeps the hwdep character device open until after disconnect and later reaches the release callback. After disconnect, the USB interface lookup can return NULL because the active configuration has been cleared.
How does the resolved behavior handle a disconnected device?
An open that finds the interface gone fails with -ENODEV. During release, the runtime-PM put is skipped if the interface is no longer present, while the remaining per-file cleanup still runs.