ASoC: qcom: q6apm: fix NULL pointer dereference in graph_callback
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 5477518b8a0e8a45239646acd80c9bafc4401522 · < 2e9261761b35f0b67b7487688cd1365f535be0b3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ASoC: qcom: q6apm: fix NULL pointer dereference in graph_callback
When q6apm_free_fragments() is called it frees rx_data.buf/tx_data.buf and sets them to NULL under graph->lock. A late DSP buffer-done response can race with this: graph_callback() passes the !graph->ar_graph guard (not yet NULL), acquires the lock, but then dereferences a now-NULL buf pointer to read buf[token].phys, crashing at virtual address 0x10.
Add a NULL check for buf inside the mutex-protected section in both the write-done (DATA_CMD_RSP_WR_SH_MEM_EP_DATA_BUFFER_DONE_V2) and read-done (DATA_CMD_RSP_RD_SH_MEM_EP_DATA_BUFFER_V2) handlers and bail out cleanly if buffers have already been freed.
This problem is only shown up recently while apr bus was updated to process the commands per service rather from single global queue.
From the CVE record · Linux
The Linux kernel's Qualcomm ASoC q6apm graph_callback can dereference a NULL buffer pointer if a late DSP buffer-done response races with buffer cleanup, causing a crash. The input does not specify whether an attacker can trigger this or what access or interaction would be required.
Engineers running Linux kernels with the affected Qualcomm ASoC q6apm code should check their kernel; affected versions are not specified.