Commit 91502cb
ASoC: SOF: ipc4-topology: Harden loops for looking up ALH copiers
mainline inclusion
from mainline-v6.14-rc4
category: bugfix
CVE: CVE-2025-21870
Other, non DAI copier widgets could have the same stream name (sname) as
the ALH copier and in that case the copier->data is NULL, no alh_data is
attached, which could lead to NULL pointer dereference.
We could check for this NULL pointer in sof_ipc4_prepare_copier_module()
and avoid the crash, but a similar loop in sof_ipc4_widget_setup_comp_dai()
will miscalculate the ALH device count, causing broken audio.
The correct fix is to harden the matching logic by making sure that the
1. widget is a DAI widget - so dai = w->private is valid
2. the dai (and thus the copier) is ALH copier
Fixes: a150345 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support")
Reported-by: Seppo Ingalsuo <[email protected]>
Link: thesofproject/sof#9652
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Liam Girdwood <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 6fd6013)
Conflicts:
sound/soc/sof/ipc4-topology.c
[Backport to linux-6.6.y, context changed because we not backport
("ASoC: SOF: ipc4-topology: Save the ALH DAI index during hw_params")]
Signed-off-by: Wentao Guan <[email protected]>1 parent ef85502 commit 91502cb
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
606 | 608 | | |
607 | 609 | | |
608 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
609 | 615 | | |
610 | 616 | | |
611 | 617 | | |
| |||
1901 | 1907 | | |
1902 | 1908 | | |
1903 | 1909 | | |
1904 | | - | |
| 1910 | + | |
1905 | 1911 | | |
1906 | 1912 | | |
1907 | 1913 | | |
1908 | 1914 | | |
| 1915 | + | |
| 1916 | + | |
1909 | 1917 | | |
1910 | 1918 | | |
1911 | 1919 | | |
| |||
0 commit comments