]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: dapm: fix out-of-bounds accesses to DAPM lookup tables
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 5 Feb 2019 16:22:27 +0000 (10:22 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 6 Feb 2019 17:25:49 +0000 (17:25 +0000)
commit2258d0055739ce939c3e8274fcb72fdf56f86268
tree3466e911b9ba6349fe97ccb051c165405bd76cec
parenta61616de66ce5d16ca50e1566e10f72c2b2a30e7
ASoC: dapm: fix out-of-bounds accesses to DAPM lookup tables

KASAN reports and additional traces point to out-of-bounds accesses to
the dapm_up_seq and dapm_down_seq lookup tables. The indices used are
larger than the array definition.

Fix by adding missing entries for the new widget types in these two
lookup tables, and align them with PGA values.

Also the sequences for the following widgets were not defined. Since
their values defaulted to zero, assign them explicitly

 snd_soc_dapm_input
 snd_soc_dapm_output
 snd_soc_dapm_vmid
 snd_soc_dapm_siggen
 snd_soc_dapm_sink

Fixes: 6fe381e168f2 ('ASoC: dapm: Add new widget type for constructing DAPM graphs on DSPs.').
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-dapm.c