Commit dd0eff7
committed
ASoC: SOF: ipc3-control: Reject ABI data size larger than the TLV payload
sof_ipc3_bytes_ext_put() copies header.length bytes from user space into
cdata->data, but the amount of payload later sent to the firmware is taken
from the ABI header's own size field. Nothing checks that the two agree, so
a user claiming a size larger than the data it actually provided makes the
driver send the stale tail of the previous control value to the DSP. The
same stale tail is returned to user space by a subsequent bytes_ext_get()
that does not read back from the DSP.
Reject the payload if the ABI size field exceeds the data available in the
TLV block. header.length has already been verified to be at least
sizeof(struct sof_abi_hdr), so the subtraction cannot underflow.
Fixes: 67ec2a0 ("ASoC: SOF: Add bytes_ext control IPC ops for IPC3")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>1 parent 2240389 commit dd0eff7
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| |||
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
452 | 462 | | |
453 | 463 | | |
454 | 464 | | |
| |||
0 commit comments