LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Wen Yang <wen.yang99@zte.com.cn>, alsa-devel@alsa-project.org
Cc: kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Cheng Shengyu <cheng.shengyu@zte.com.cn>,
	Jaroslav Kysela <perex@perex.cz>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Sangbeom Kim <sbkim73@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Takashi Iwai <tiwai@suse.com>,
	Xue Zhihong <xue.zhihong@zte.com.cn>,
	Yi Wang <wang.yi59@zte.com.cn>
Subject: Re: [2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai
Date: Sun, 14 Jul 2019 14:47:18 +0200
Message-ID: <4545ce50-493c-8faa-fdcd-5aee3ca30792@web.de> (raw)
In-Reply-To: <1562989575-33785-3-git-send-email-wen.yang99@zte.com.cn>

> The cpu_dai variable is still being used after the of_node_put() call,

Such an implementation detail is questionable.
https://wiki.sei.cmu.edu/confluence/display/c/MEM30-C.+Do+not+access+freed+memory


> which may result in double-free:

This consequence is also undesirable.
https://cwe.mitre.org/data/definitions/415.html


Now I wonder if two update steps are really appropriate as a fix
instead of using a single update step for the desired correction
in this software module.
Should a commit (including previous ones) usually be correct by itself?

Regards,
Markus

  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-13  3:46 [PATCH 0/2] ASoC: samsung: odroid: fix err handling of odroid_audio_probe Wen Yang
2019-07-13  3:46 ` [PATCH 1/2] ASoC: samsung: odroid: fix an use-after-free issue for codec Wen Yang
2019-07-14  8:47   ` Markus Elfring
2019-07-14 10:55   ` [1/2] " Markus Elfring
2019-07-13  3:46 ` [PATCH 2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai Wen Yang
2019-07-14 12:47   ` Markus Elfring [this message]
2019-07-14 10:07 ` [PATCH 0/2] ASoC: samsung: odroid: fix err handling of odroid_audio_probe Markus Elfring
     [not found] <201907150949139435825@zte.com.cn>
2019-07-15  6:40 ` [2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai Markus Elfring

Reply instructions:

You may reply publically 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=4545ce50-493c-8faa-fdcd-5aee3ca30792@web.de \
    --to=markus.elfring@web.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cheng.shengyu@zte.com.cn \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=s.nawrocki@samsung.com \
    --cc=sbkim73@samsung.com \
    --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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox