CVE-2026-31778
Severity CVSS v4.0:
Pending analysis
Type:
CWE-125
Out-of-bounds Read
Publication date:
01/05/2026
Last modified:
11/05/2026
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
ALSA: caiaq: fix stack out-of-bounds read in init_card<br />
<br />
The loop creates a whitespace-stripped copy of the card shortname<br />
where `len id)` is used for the bounds check. Since<br />
sizeof(card->id) is 16 and the local id buffer is also 16 bytes,<br />
writing 16 non-space characters fills the entire buffer,<br />
overwriting the terminating nullbyte.<br />
<br />
When this non-null-terminated string is later passed to<br />
snd_card_set_id() -> copy_valid_id_string(), the function scans<br />
forward with `while (*nid && ...)` and reads past the end of the<br />
stack buffer, reading the contents of the stack.<br />
<br />
A USB device with a product name containing many non-ASCII, non-space<br />
characters (e.g. multibyte UTF-8) will reliably trigger this as follows:<br />
<br />
BUG: KASAN: stack-out-of-bounds in copy_valid_id_string<br />
sound/core/init.c:696 [inline]<br />
BUG: KASAN: stack-out-of-bounds in snd_card_set_id_no_lock+0x698/0x74c<br />
sound/core/init.c:718<br />
<br />
The off-by-one has been present since commit bafeee5b1f8d ("ALSA:<br />
snd_usb_caiaq: give better shortname") from June 2009 (v2.6.31-rc1),<br />
which first introduced this whitespace-stripping loop. The original<br />
code never accounted for the null terminator when bounding the copy.<br />
<br />
Fix this by changing the loop bound to `sizeof(card->id) - 1`,<br />
ensuring at least one byte remains as the null terminator.
Impact
Base Score 3.x
7.10
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 2.6.31 (including) | 5.10.253 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.203 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 6.1.168 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.134 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.12.81 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.13 (including) | 6.18.22 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.19 (including) | 6.19.12 (excluding) |
| cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/02d9c5b0b5553a391448b6d655262bd829f90234
- https://git.kernel.org/stable/c/3178b62e2e31bab39f63d4c8e54bf4ee0a425627
- https://git.kernel.org/stable/c/3afa2e67f3523a980a2f90fd63c22322ac2b9ce0
- https://git.kernel.org/stable/c/3f7f8bae0d52cbd07ab04b76b6aac89ef98ee9f6
- https://git.kernel.org/stable/c/45424e871abf2a152e247a9cff78359f18dd95c0
- https://git.kernel.org/stable/c/66194c2575a4f567577ae70b1d7561163ce791a6
- https://git.kernel.org/stable/c/7594a6464873d90fd229e5b94cdd3b92c9feabed
- https://git.kernel.org/stable/c/a82c1bce2d1299dd3c686a8fe48cf75b79a403c7



