stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.14 09/27] ASoC: dapm: fix out-of-bounds accesses to DAPM lookup tables
Date: Mon, 11 Mar 2019 15:58:06 -0400	[thread overview]
Message-ID: <20190311195824.139043-9-sashal@kernel.org> (raw)
In-Reply-To: <20190311195824.139043-1-sashal@kernel.org>

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

[ Upstream commit c16e12010060c6c7a31f08b4a99513064cb53b7d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/soc-dapm.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 53c9d7525639..c8cdbe4b5680 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -75,12 +75,16 @@ static int dapm_up_seq[] = {
 	[snd_soc_dapm_clock_supply] = 1,
 	[snd_soc_dapm_supply] = 2,
 	[snd_soc_dapm_micbias] = 3,
+	[snd_soc_dapm_vmid] = 3,
 	[snd_soc_dapm_dai_link] = 2,
 	[snd_soc_dapm_dai_in] = 4,
 	[snd_soc_dapm_dai_out] = 4,
 	[snd_soc_dapm_aif_in] = 4,
 	[snd_soc_dapm_aif_out] = 4,
 	[snd_soc_dapm_mic] = 5,
+	[snd_soc_dapm_siggen] = 5,
+	[snd_soc_dapm_input] = 5,
+	[snd_soc_dapm_output] = 5,
 	[snd_soc_dapm_mux] = 6,
 	[snd_soc_dapm_demux] = 6,
 	[snd_soc_dapm_dac] = 7,
@@ -88,11 +92,19 @@ static int dapm_up_seq[] = {
 	[snd_soc_dapm_mixer] = 8,
 	[snd_soc_dapm_mixer_named_ctl] = 8,
 	[snd_soc_dapm_pga] = 9,
+	[snd_soc_dapm_buffer] = 9,
+	[snd_soc_dapm_scheduler] = 9,
+	[snd_soc_dapm_effect] = 9,
+	[snd_soc_dapm_src] = 9,
+	[snd_soc_dapm_asrc] = 9,
+	[snd_soc_dapm_encoder] = 9,
+	[snd_soc_dapm_decoder] = 9,
 	[snd_soc_dapm_adc] = 10,
 	[snd_soc_dapm_out_drv] = 11,
 	[snd_soc_dapm_hp] = 11,
 	[snd_soc_dapm_spk] = 11,
 	[snd_soc_dapm_line] = 11,
+	[snd_soc_dapm_sink] = 11,
 	[snd_soc_dapm_kcontrol] = 12,
 	[snd_soc_dapm_post] = 13,
 };
@@ -105,13 +117,25 @@ static int dapm_down_seq[] = {
 	[snd_soc_dapm_spk] = 3,
 	[snd_soc_dapm_line] = 3,
 	[snd_soc_dapm_out_drv] = 3,
+	[snd_soc_dapm_sink] = 3,
 	[snd_soc_dapm_pga] = 4,
+	[snd_soc_dapm_buffer] = 4,
+	[snd_soc_dapm_scheduler] = 4,
+	[snd_soc_dapm_effect] = 4,
+	[snd_soc_dapm_src] = 4,
+	[snd_soc_dapm_asrc] = 4,
+	[snd_soc_dapm_encoder] = 4,
+	[snd_soc_dapm_decoder] = 4,
 	[snd_soc_dapm_switch] = 5,
 	[snd_soc_dapm_mixer_named_ctl] = 5,
 	[snd_soc_dapm_mixer] = 5,
 	[snd_soc_dapm_dac] = 6,
 	[snd_soc_dapm_mic] = 7,
+	[snd_soc_dapm_siggen] = 7,
+	[snd_soc_dapm_input] = 7,
+	[snd_soc_dapm_output] = 7,
 	[snd_soc_dapm_micbias] = 8,
+	[snd_soc_dapm_vmid] = 8,
 	[snd_soc_dapm_mux] = 9,
 	[snd_soc_dapm_demux] = 9,
 	[snd_soc_dapm_aif_in] = 10,
-- 
2.19.1


  parent reply	other threads:[~2019-03-11 20:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 19:57 [PATCH AUTOSEL 4.14 01/27] drm/imx: ignore plane updates on disabled crtcs Sasha Levin
2019-03-11 19:57 ` [PATCH AUTOSEL 4.14 02/27] gpu: ipu-v3: Fix i.MX51 CSI control registers offset Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 03/27] drm/imx: imx-ldb: add missing of_node_puts Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 04/27] gpu: ipu-v3: Fix CSI offsets for imx53 Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 05/27] s390/dasd: fix using offset into zero size array error Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 06/27] Input: pwm-vibra - prevent unbalanced regulator Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 07/27] Input: pwm-vibra - stop regulator after disabling pwm, not before Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 08/27] ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized Sasha Levin
2019-03-11 19:58 ` Sasha Levin [this message]
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 10/27] ASoC: rsnd: fixup rsnd_ssi_master_clk_start() user count check Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 11/27] KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 12/27] ARM: OMAP2+: fix lack of timer interrupts on CPU1 after hotplug Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 13/27] Input: cap11xx - switch to using set_brightness_blocking() Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 14/27] Input: ps2-gpio - flush TX work when closing port Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 15/27] Input: matrix_keypad - use flush_delayed_work() Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 16/27] mac80211: Fix Tx aggregation session tear down with ITXQs Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 17/27] ipvs: fix dependency on nf_defrag_ipv6 Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 18/27] floppy: check_events callback should not return a negative number Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 19/27] NFS: Don't use page_file_mapping after removing the page Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 20/27] mm/gup: fix gup_pmd_range() for dax Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 21/27] Revert "mm: use early_pfn_to_nid in page_ext_init" Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 22/27] mm: page_alloc: fix ref bias in page_frag_alloc() for 1-byte allocs Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 23/27] net: hns: Fix object reference leaks in hns_dsaf_roce_reset() Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 24/27] i2c: cadence: Fix the hold bit setting Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 25/27] i2c: bcm2835: Clear current buffer pointers and counts after a transfer Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 26/27] auxdisplay: ht16k33: fix potential user-after-free on module unload Sasha Levin
2019-03-11 19:58 ` [PATCH AUTOSEL 4.14 27/27] Input: st-keyscan - fix potential zalloc NULL dereference Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311195824.139043-9-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).