CVE-2022-49518
Published: 26 February 2025
Description
In the Linux kernel, the following vulnerability has been resolved: ASoC: SOF: ipc3-topology: Correct get_control_data for non bytes payload It is possible to craft a topology where sof_get_control_data() would do out of bounds access because it expects that it is only called when the payload is bytes type. Confusingly it also handles other types of controls, but the payload parsing implementation is only valid for bytes. Fix the code to count the non bytes controls and instead of storing a pointer to sof_abi_hdr in sof_widget_data (which is only valid for bytes), store the pointer to the data itself and add a new member to save the size of the data. In case of non bytes controls we store the pointer to the chanv itself, which is just an array of values at the end. In case of bytes control, drop the wrong cdata->data (wdata[i].pdata) check against NULL since it is incorrect and invalid in this context. The data is pointing to the end of cdata struct, so it should never be null.
Security Summary
CVE-2022-49518 is a vulnerability in the Linux kernel's ASoC (ALSA System on Chip) SOF (Sound Open Firmware) ipc3-topology component. The issue stems from an out-of-bounds read (CWE-125) in the sof_get_control_data() function, which assumes payloads are of bytes type but can be invoked for other control types. This allows crafted topologies to trigger invalid memory access, as the function incorrectly stores pointers to sof_abi_hdr in sof_widget_data for non-bytes payloads and performs flawed parsing.
A local attacker with low privileges (AV:L/PR:L) can exploit this vulnerability with low complexity and no user interaction required. Successful exploitation leads to high-impact confidentiality loss through arbitrary reads and high-impact availability disruption, such as kernel crashes, but without integrity modification (CVSS 3.1 score: 7.1 High).
The provided patch references detail the mitigation via kernel stable commits. The fixes include counting non-bytes controls separately, storing pointers directly to the data (chanv array for non-bytes) with a new size member, and correcting bytes handling by removing an invalid NULL check on cdata->data, which always points to valid data at the struct's end. Security practitioners should apply these updates from the Linux kernel stable trees.
Details
- CWE(s)