CVE-2026-99314: ALSA: us122l: Add missing NULL check in usb_stream_hwdep_mmap()
In the Linux kernel, the following vulnerability has been resolved:
ALSA: us122l: Add missing NULL check in usbstreamhwdepmmap()
usbstreamhwdepmmap() reads us122l->sk.s and dereferences it without checking for NULL. The stream object is released by usbstreamfree(), which is reached through us122lstop() both when the device is disconnected and when us122lstart() fails, and it leaves us122l->sk.s set to NULL. The hwdep file stays usable after that, so a later mmap()
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] RIP: 0010:usbstreamhwdepmmap+0x107/0x890 sound/usb/usx2y/us122l.c:182
crashes while reading s->readsize, which sits at offset 0x10.
That NULL is an expected state for this field: usbstreamhwdepvmfault(), usbstreamhwdeppoll(), usbstreamhwdepioctl(), usbstreamstop() and usbstreamfree() all test it before use. Only the mmap callback misses the check, so let it return -ENODEV, matching what the other hwdep mapping in usx2yhwdeppcm.c does when its shared buffer has not been allocated.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In usb_stream_hwdep_mmap(), check whether us122l->sk.s is NULL before dereferencing it, and return -ENODEV when it is NULL.
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems using the Linux kernel ALSA us122l USB audio driver are exposed when a hwdep file remains usable after the associated stream has been released, such as after device disconnection or a failed stream start.
What action triggers the crash?
A later mmap() call on the still-usable hwdep file can dereference the released stream pointer, which has been set to NULL, and crash the kernel.
How can the vulnerable condition be recognized?
The condition can produce a KASAN null-pointer dereference in usb_stream_hwdep_mmap() while reading s->read_size. It occurs after usb_stream_free() has cleared us122l->sk.s to NULL.
What happens after the fix when the stream is unavailable?
Instead of dereferencing the NULL stream pointer, the mmap callback returns -ENODEV when the stream object is no longer available.