HIGH Introduced in 4.19
meson-card DAILink UAF
CVE-2026-93039
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: ASoC: meson: Keep link pointers valid on realloc failure meson_card_reallocate_links() grows the DAI link and private data arrays with two consecutive krealloc() calls and updates the owner pointers only after both calls have succeeded. A successful krealloc() may move the data: it frees the old block and returns a new one. When that happens for the link array and the second krealloc() then fails, card->dai_link still points to the block that krealloc() already freed, and the error path frees the new block too. The probe error path then calls meson_card_clean_references(), which dereferences card->dai_link and kfree()s it again, resulting in a use-after-free and a double free. Commit card->dai_link and card->num_links right after the first krealloc() succeeds, so the pointer always refers to a valid allocation that meson_card_clean_references() can walk and free. krealloc() with __GFP_ZERO zero-initializes the added entries, so walking them on the error path is safe. With both failure paths reduced to a plain return, drop the goto labels and the error message.
02KernelScan AI Analysis
Risk summary
A use-after-free and double-free in the Meson ASoC sound card driver can be triggered when memory allocation fails during audio card initialization. An unprivileged local user on Meson SoC hardware could induce memory pressure to cause the failure, leading to kernel heap corruption. The bug requires specific Amlogic Meson hardware and precise timing of allocation failures during driver probe.
Vulnerability analysis
During audio card initialization on Meson platforms, the driver grows two internal arrays with consecutive memory reallocation calls but only commits the updated pointers after both calls succeed. When the first reallocation succeeds and moves the data to a new block while the second fails, the error path frees the new block but leaves a stale pointer to the already-freed old block. The driver's cleanup routine then dereferences and frees that stale pointer, causing a use-after-free and double-free. The fix commits the pointer and link count immediately after the first reallocation succeeds, so the cleanup routine always walks a valid allocation; the second failure path simply returns an error and lets normal cleanup handle the valid pointer. This path is reachable only on systems with the Meson ASoC driver loaded, and an unprivileged local user would need to induce memory pressure during the driver probe window to trigger the allocation failure.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 4.19 | 5.10.270 | de33afc57f24 |
| 5.15 | 4.19 | 5.15.221 | 1c1485343b7c |
| 6.1 | 4.19 | 6.1.188 | 8db0a0fc84e8 |
| 6.12 | 4.19 | 6.12.110 | 0b30fbe6bf7c |
| 6.18 | 4.19 | 6.18.52 | 8fec16898f18 |
| 6.6 | 4.19 | 6.6.157 | 41e92e0caa1f |
| 7.2 | 4.19 | 7.2.6 | 5ed1b048527b |
| mainline | 4.19 | 7.3 | 2aaa41cf974f |
| cip/5.10 | 4.19 | 5.10.271-cip78 | de33afc57f24 |
| cip/6.1 | 4.19 | 6.1.189-cip61 | 8db0a0fc84e8 |
| cip/6.1-rt | 4.19 | 6.1.189-cip61-rt32 | 8db0a0fc84e8 |
| cip/6.12 | 4.19 | 6.12.111-cip32 | 0b30fbe6bf7c |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.111-cip32 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.268-cip77-rt34) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |