Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kuninori Morimoto" <kuninori.morimoto.gx@renesas.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 06/11] ASoC: soc-core: rename list to unbind_list
Date: Fri, 27 Nov 2026 00:03:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-236353@kernel.org> (raw)
In-Reply-To: <87mrqvqh5v.wl-kuninori.morimoto.gx@renesas.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] ASoC: core: premature devres_destroy() in
  devm_snd_soc_bind_card() [1]
--

commit b28ef687acfb86f7ec423e7fb74b4c460388a35d
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: soc-core: rename list to unbind_list

This commit renames struct snd_soc_card's list member to unbind_list and
unbind_card_list to unbind_list_head to clarify their purpose.

> diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c
> index e0f617077ee80..951ae9ff13557 100644
> --- a/sound/soc/soc-card.c
> +++ b/sound/soc/soc-card.c

[ ... ]

> @@ -1093,7 +1093,7 @@ void snd_soc_card_rebind(void)
>  {
>  	struct snd_soc_card *card, *c;
>  
> -	list_for_each_entry_safe(card, c, &unbind_card_list, list)
> +	list_for_each_entry_safe(card, c, &unbind_list_head, unbind_list)
>  		snd_soc_card_bind_call(card);
>  }

[Severity: Critical]
This problem wasn't introduced by this patch, but can a failed
devres_alloc() during rebind leave a devm-registered card on
unbind_list_head without its release callback [1]?

sound/soc/soc-card.c:devm_snd_soc_card_bind() {
    ...
	devres_destroy(dev, devm_snd_soc_card_bind_release, NULL, NULL);

	ptr = devres_alloc(devm_snd_soc_card_bind_release, sizeof(*ptr), GFP_KERNEL);
	if (!ptr)
		return -ENOMEM;

	ret = snd_soc_card_bind(card);
    ...
}

When snd_soc_card_rebind() calls snd_soc_card_bind_call() ->
devm_snd_soc_card_bind() for a card on unbind_list_head, the existing
devm_snd_soc_card_bind_release entry is destroyed before devres_alloc().
If devres_alloc() fails, devm_snd_soc_card_bind() returns -ENOMEM before
snd_soc_card_bind() removes card->unbind_list from unbind_list_head and
without re-adding the release callback.  When the card device is later
unbound and card is freed, snd_soc_unregister_card() is not called, leaving
a dangling entry on unbind_list_head and causing a use-after-free on the
next list traversal.

[1] https://sashiko.dev/#/bug/linux-3f727b31-7250-473d-8b80-c09bf6f2bb4c

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/87v75jqh7j.wl-kuninori.morimoto.gx@renesas.com?part=6

  reply	other threads:[~2026-11-27  0:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 23:57 [PATCH 00/11] ASoC: rename DAI/Component list name Kuninori Morimoto
2026-11-26 23:57 ` [PATCH 01/11] ASoC: soc-dai: rename list to dai_list Kuninori Morimoto
2026-11-26 23:57 ` [PATCH 02/11] ASoC: soc-component: rename card_aux_list to aux_list Kuninori Morimoto
2026-11-26 23:58 ` [PATCH 03/11] ASoC: soc-component: rename list to component_total_list Kuninori Morimoto
2026-11-26 23:58 ` [PATCH 04/11] ASoC: soc-component: rename card_list to component_list Kuninori Morimoto
2026-11-26 23:58 ` [PATCH 05/11] ASoC: soc-core: rename list to rtd_list Kuninori Morimoto
2026-11-26 23:58 ` [PATCH 06/11] ASoC: soc-core: rename list to unbind_list Kuninori Morimoto
2026-11-27  0:03   ` sashiko-bot [this message]
2026-11-26 23:58 ` [PATCH 07/11] ASoC: soc-dapm: rename list to dobj_list Kuninori Morimoto
2026-11-26 23:58 ` [PATCH 08/11] ASoC: soc-dapm: rename list to widget_list Kuninori Morimoto
2026-11-26 23:58 ` [PATCH 09/11] ASoC: soc-dapm: rename list to path_list Kuninori Morimoto
2026-11-26 23:58 ` [PATCH 10/11] ASoC: soc-dapm: rename list to dapm_list Kuninori Morimoto
2026-11-26 23:58 ` [PATCH 11/11] ASoC: soc-dapm: rename darty to dapm_darty_list Kuninori Morimoto
2026-11-27  0:05   ` sashiko-bot

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=sashiko-outbox-236353@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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