Commit 8e8cb5c
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 <seppo.ingalsuo@linux.intel.com>
Link: thesofproject/sof#9652
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250206084642.14988-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(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 <guanwentao@uniontech.com>1 parent 5a1fe60 commit 8e8cb5c
1 file changed
Lines changed: 10 additions & 2 deletions
| 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