linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Wen Yang <wen.yang99@zte.com.cn>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
	cheng.shengyu@zte.com.cn, jonathanh@nvidia.com,
	kuninori.morimoto.gx@renesas.com,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
	Mark Brown <broonie@kernel.org>,
	tiwai@suse.com, wang.yi59@zte.com.cn, xue.zhihong@zte.com.cn
Subject: Applied "ASoC: simple-card: fix an use-after-free in simple_for_each_link()" to the asoc tree
Date: Wed, 10 Jul 2019 16:34:44 +0100 (BST)	[thread overview]
Message-ID: <20190710153444.3A14AD02D7C@fitzroy.sirena.org.uk> (raw)
In-Reply-To: <1562743509-30496-3-git-send-email-wen.yang99@zte.com.cn>

The patch

   ASoC: simple-card: fix an use-after-free in simple_for_each_link()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 27862d5a3325bc531ec15e3c607e44aa0fd57f6f Mon Sep 17 00:00:00 2001
From: Wen Yang <wen.yang99@zte.com.cn>
Date: Wed, 10 Jul 2019 15:25:07 +0800
Subject: [PATCH] ASoC: simple-card: fix an use-after-free in
 simple_for_each_link()

The codec variable is still being used after the of_node_put() call,
which may result in use-after-free.

Fixes: d947cdfd4be2 ("ASoC: simple-card: cleanup DAI link loop method - step1")
Link: https://lore.kernel.org/r/1562743509-30496-3-git-send-email-wen.yang99@zte.com.cn
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/generic/simple-card.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 4117e54884e5..ef849151ba56 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -364,8 +364,6 @@ static int simple_for_each_link(struct asoc_simple_priv *priv,
 			goto error;
 		}
 
-		of_node_put(codec);
-
 		/* get convert-xxx property */
 		memset(&adata, 0, sizeof(adata));
 		for_each_child_of_node(node, np)
@@ -387,11 +385,13 @@ static int simple_for_each_link(struct asoc_simple_priv *priv,
 				ret = func_noml(priv, np, codec, li, is_top);
 
 			if (ret < 0) {
+				of_node_put(codec);
 				of_node_put(np);
 				goto error;
 			}
 		}
 
+		of_node_put(codec);
 		node = of_get_next_child(top, node);
 	} while (!is_top && node);
 
-- 
2.20.1


  reply	other threads:[~2019-07-10 15:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10  7:25 [PATCH 0/4] Fix some use-after-free problems in sound/soc/generic Wen Yang
2019-07-10  7:25 ` [PATCH 1/4] ASoC: simple-card: fix an use-after-free in simple_dai_link_of_dpcm() Wen Yang
2019-07-10 15:34   ` Applied "ASoC: simple-card: fix an use-after-free in simple_dai_link_of_dpcm()" to the asoc tree Mark Brown
2019-07-10  7:25 ` [PATCH 2/4] ASoC: simple-card: fix an use-after-free in simple_for_each_link() Wen Yang
2019-07-10 15:34   ` Mark Brown [this message]
2019-07-10  7:25 ` [PATCH 3/4] ASoC: audio-graph-card: fix use-after-free in graph_dai_link_of_dpcm() Wen Yang
2019-07-10 15:34   ` Applied "ASoC: audio-graph-card: fix use-after-free in graph_dai_link_of_dpcm()" to the asoc tree Mark Brown
2019-07-10  7:25 ` [PATCH 4/4] ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id() Wen Yang
2019-07-10 15:34   ` Applied "ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()" to the asoc tree Mark Brown
2019-07-10  8:07 ` [PATCH 0/4] Fix some use-after-free problems in sound/soc/generic Kuninori Morimoto

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=20190710153444.3A14AD02D7C@fitzroy.sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=cheng.shengyu@zte.com.cn \
    --cc=jonathanh@nvidia.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=wang.yi59@zte.com.cn \
    --cc=wen.yang99@zte.com.cn \
    --cc=xue.zhihong@zte.com.cn \
    /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).