linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>,
	Jaroslav Kysela <perex@perex.cz>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Peter Rosin <peda@axentia.se>,
	Peter Ujfalusi <peter.ujfalusi@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH 0/6] ASoC: use devm_snd_soc_register_card()
Date: Wed, 10 Jan 2024 09:33:33 +0100	[thread overview]
Message-ID: <87zfxdpoyq.wl-tiwai@suse.de> (raw)
In-Reply-To: <877ckigepg.wl-kuninori.morimoto.gx@renesas.com>

On Wed, 10 Jan 2024 02:27:39 +0100,
Kuninori Morimoto wrote:
> 
> 
> Hi Mark
> 
> We can use devm_snd_soc_register_card()
> instead of      snd_soc_register_card(),  and is possible
> to ignore       snd_soc_unregister_card().

I haven't looked through all code changes, but in general, be careful
when the driver is releasing something else than the devres-managed
stuff.  Namely, the devres stuff is released *after* the call of
remove callback.

For example, in your patch for cirrus driver:

 static void edb93xx_remove(struct platform_device *pdev)
 {
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	snd_soc_unregister_card(card);
 	ep93xx_i2s_release();
 }
 
This will end up with different call orders of soc-unregister and
ep93xx_i2s_release().  This kind of changes may easily be a hidden
source of UAF.


Takashi

  parent reply	other threads:[~2024-01-10  8:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10  1:27 [PATCH 0/6] ASoC: use devm_snd_soc_register_card() Kuninori Morimoto
2024-01-10  1:27 ` [PATCH 1/6] ASoC: ti: " Kuninori Morimoto
2024-01-10  1:28 ` [PATCH 2/6] ASoC: fsl: " Kuninori Morimoto
2024-01-10  1:28 ` [PATCH 3/6] ASoC: atmel: " Kuninori Morimoto
2024-01-10  9:55   ` Peter Rosin
2024-01-10  1:28 ` [PATCH 4/6] ASoC: sunxi: " Kuninori Morimoto
2024-01-10  1:28 ` [PATCH 5/6] ASoC: ux500: " Kuninori Morimoto
2024-01-10  1:28 ` [PATCH 6/6] ASoC: cirrus: " Kuninori Morimoto
2024-01-10  8:33 ` Takashi Iwai [this message]
2024-01-11  0:02   ` [PATCH 0/6] ASoC: " 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=87zfxdpoyq.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=jarkko.nikula@bitmer.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=peda@axentia.se \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@gmail.com \
    --cc=samuel@sholland.org \
    --cc=tiwai@suse.com \
    --cc=wens@csie.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).