From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Jaroslav Kysela <perex-/Fr2/VpizcU@public.gmane.org>
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org,
hochi.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
michael.hsiao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
KaiChieh Chuang
<kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Subject: Re: [alsa-devel] [RFC PATCH v2] ASoC: dpcm: prevent snd_soc_dpcm use after free
Date: Wed, 6 Mar 2019 17:09:44 +0000 [thread overview]
Message-ID: <20190306170944.GD21220@sirena.org.uk> (raw)
In-Reply-To: <0c9de818-80b4-d172-422d-a96b47aa7f1e-/Fr2/VpizcU@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 528 bytes --]
On Wed, Mar 06, 2019 at 10:19:38AM +0100, Jaroslav Kysela wrote:
> Dne 06. 03. 19 v 9:46 KaiChieh Chuang napsal(a):
> > + spin_lock(&fe->card->dpcm_lock);
> > list_del(&dpcm->list_be);
> > list_del(&dpcm->list_fe);
> > kfree(dpcm);
> > + spin_unlock(&fe->card->dpcm_lock);
> The unlock might be moved before kfree(). Also, I don't see the
> list_add() spin lock protection in your patch.
Yes, the free *needs* to be outside of the spinlocked section - we
shouldn't do dynamic memory operations in atomics context.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 200 bytes --]
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
prev parent reply other threads:[~2019-03-06 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-06 8:46 [RFC PATCH v2] ASoC: dpcm: prevent snd_soc_dpcm use after free KaiChieh Chuang
[not found] ` <1551861979-26601-1-git-send-email-kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2019-03-06 9:19 ` [alsa-devel] " Jaroslav Kysela
[not found] ` <0c9de818-80b4-d172-422d-a96b47aa7f1e-/Fr2/VpizcU@public.gmane.org>
2019-03-06 15:09 ` KaiChieh Chuang
2019-03-06 17:09 ` Mark Brown [this message]
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=20190306170944.GD21220@sirena.org.uk \
--to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=hochi.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=michael.hsiao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=perex-/Fr2/VpizcU@public.gmane.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