KernelScan.io

HIGH

alsa Caiaq OOB

CVE-2026-31778

CVSS 7.1 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H

KernelScan AI2.3LOW

01

In the Linux kernel, the following vulnerability has been resolved: ALSA: caiaq: fix stack out-of-bounds read in init_card The loop creates a whitespace-stripped copy of the card shortname where `len < sizeof(card->id)` is used for the bounds check. Since sizeof(card->id) is 16 and the local id buffer is also 16 bytes, writing 16 non-space characters fills the entire buffer, overwriting the terminating nullbyte. When this non-null-terminated string is later passed to snd_card_set_id() -> copy_valid_id_string(), the function scans forward with `while (*nid && ...)` and reads past the end of the stack buffer, reading the contents of the stack. A USB device with a product name containing many non-ASCII, non-space characters (e.g. multibyte UTF-8) will reliably trigger this as follows: BUG: KASAN: stack-out-of-bounds in copy_valid_id_string sound/core/init.c:696 [inline] BUG: KASAN: stack-out-of-bounds in snd_card_set_id_no_lock+0x698/0x74c sound/core/init.c:718 The off-by-one has been present since commit bafeee5b1f8d ("ALSA: snd_usb_caiaq: give better shortname") from June 2009 (v2.6.31-rc1), which first introduced this whitespace-stripping loop. The original code never accounted for the null terminator when bounding the copy. Fix this by changing the loop bound to `sizeof(card->id) - 1`, ensuring at least one byte remains as the null terminator.

02

Engine v0.2.0

Risk summary

Physical attackers with USB device access can trigger a stack out-of-bounds read in the ALSA Caiaq driver by connecting a malicious USB audio device with a specially crafted product name. This can leak kernel stack contents but does not allow code execution or system compromise.

Affectedsound/usb/caiaq/device.c (ALSA USB Caiaq driver)

Vulnerability analysis

The vulnerability is an off-by-one error in the init_card() function where a loop copies non-space characters from a USB device's product name to a 16-byte stack buffer. The bounds check uses `len < sizeof(card->id)` (16) instead of `sizeof(card->id) - 1` (15), allowing 16 characters to fill the entire buffer and overwrite the null terminator. When this non-null-terminated string is passed to snd_card_set_id(), the copy_valid_id_string() function reads past the buffer end using `while (*nid && ...)`, causing a stack out-of-bounds read that can leak kernel memory contents. The fix changes the loop bound to `sizeof(card->id) - 1` to preserve space for the null terminator. This requires physical USB access to trigger.

03

BranchFixed inPatch commit
5.105.10.25302d9c5b0b555
5.155.15.2033f7f8bae0d52
6.16.1.16866194c2575a4
6.126.12.813178b62e2e31
6.186.18.223afa2e67f352
6.196.19.127594a6464873
6.66.6.134a82c1bce2d12
mainline7.045424e871abf