ASoC: SOF: topology: validate vendor array size before parsing
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
756c48bdf23050def518e85929be6edea9ae6823| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ASoC: SOF: topology: validate vendor array size before parsing
sof_parse_token_sets() reads array->size while iterating over topology private data. The loop condition only checks that some data remains, so a malformed topology with a truncated trailing vendor array can make the parser read the size field before a full vendor-array header is available.
Validate that the remaining private data contains a complete snd_soc_tplg_vendor_array header before reading array->size.
The declared array size check also needs to remain signed. asize is an int, but sizeof(*array) has type size_t, so comparing them directly promotes negative asize values to unsigned and lets them pass the check, as reported in the stable review thread reference below.
Cast sizeof(*array) to int when validating the declared array size. This rejects negative, zero and otherwise too-small sizes before the parser dispatches to the tuple-specific code.
From the CVE record · Linux
The Linux kernel’s ASoC SOF topology parser can read a vendor-array size field before a complete header is available. A malformed topology with a truncated trailing vendor array can trigger the read during parsing; the input does not specify how an attacker could supply the topology or whether authentication is required.
Engineers running Linux kernels with ASoC SOF topology support should check their versions; affected versions are not specified.