Commit f4aa5e2
ASoC: dapm: Move dai_link widgets to runtime to fix use after free
The newly added CODEC to CODEC DAI link widget pointers in
snd_soc_dai_link are better placed in snd_soc_pcm_runtime.
snd_soc_dai_link is really intended for static configuration of
the DAI, and the runtime for dynamic data. The snd_soc_dai_link
structures are not destroyed if the card is unbound. The widgets
are cleared up on unbind, however if the card is rebound as the
snd_soc_dai_link structures are reused these pointers will be left at
their old values, causing access to freed memory.
Fixes: 595571c ("ASoC: dapm: Fix regression introducing multiple copies of DAI widgets")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200526161930.30759-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 53a58bf commit f4aa5e2
2 files changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | 793 | | |
797 | 794 | | |
798 | 795 | | |
| |||
1156 | 1153 | | |
1157 | 1154 | | |
1158 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
1159 | 1159 | | |
1160 | 1160 | | |
1161 | 1161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4340 | 4340 | | |
4341 | 4341 | | |
4342 | 4342 | | |
4343 | | - | |
| 4343 | + | |
4344 | 4344 | | |
4345 | 4345 | | |
4346 | 4346 | | |
4347 | 4347 | | |
4348 | | - | |
| 4348 | + | |
4349 | 4349 | | |
4350 | 4350 | | |
4351 | 4351 | | |
4352 | | - | |
| 4352 | + | |
4353 | 4353 | | |
4354 | 4354 | | |
4355 | 4355 | | |
| |||
4358 | 4358 | | |
4359 | 4359 | | |
4360 | 4360 | | |
4361 | | - | |
| 4361 | + | |
4362 | 4362 | | |
4363 | 4363 | | |
4364 | 4364 | | |
4365 | 4365 | | |
4366 | | - | |
| 4366 | + | |
4367 | 4367 | | |
4368 | 4368 | | |
4369 | 4369 | | |
4370 | | - | |
| 4370 | + | |
4371 | 4371 | | |
4372 | 4372 | | |
4373 | 4373 | | |
| |||
0 commit comments