OSDN Git Service

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)
commitc16e12010060c6c7a31f08b4a99513064cb53b7d
tree3466e911b9ba6349fe97ccb051c165405bd76cec
parent52abe6cc1866ac3d54612f5d80563e6608c0ddfc
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: 8a70b4544ef4 ('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