* [PATCH v2 0/1] ASoC: dpcm: acquire dpcm_lock in dpcm_do_trigger()
[not found] <CGME20201203053224epcas2p1fa702ea12a9869f5c73ec60c760a3131@epcas2p1.samsung.com>
@ 2020-12-03 5:32 ` Gyeongtaek Lee
2020-12-03 7:02 ` Kuninori Morimoto
0 siblings, 1 reply; 2+ messages in thread
From: Gyeongtaek Lee @ 2020-12-03 5:32 UTC (permalink / raw)
To: 'Kuninori Morimoto', cpgs
Cc: alsa-devel, khw0178.kim, 'Takashi Iwai',
'Pierre-Louis Bossart', lgirdwood, kimty, donggyun.ko,
hmseo, cpgs, s47.kang, pilsun.jang, tkjung
On 03 Dec 2020 07:33:03 +0900, Kuninori Morimoto wrote:
>Hi Gyeongtaek
>
>Thank you for your patch
>
>> If stop by underrun and DPCM BE disconnection is run simultaneously,
>> data abort can be occurred by the sequence below.
>>
>> /* In core X, running dpcm_be_dai_trigger() */
>> for_each_dpcm_be(fe, stream, dpcm) {
>> /* In core Y, running dpcm_be_disconnect() */
>> spin_lock_irqsave(&fe->card->dpcm_lock, flags);
>> list_del(&dpcm->list_be);
>> list_del(&dpcm->list_fe);
>> spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);
>> kfree(dpcm);
>> /* In core X, running dpcm_be_dai_trigger() */
>> struct snd_soc_pcm_runtime *be = dpcm->be; <== Accessing freed memory
>
>It is easy to read/understand if this code has alignment.
>
>> To prevent this situation, dpcm_lock should be acquired during
>> iteration of dpcm list in dpcm_do_trigger().
>>
>> Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
>> Cc: stable@vger.kernel.org
>> ---
>
>Is this bugfix patch for some recent commit ?
>If so, having Fixes: tag is helpful.
>
>Thank you for your help !!
I tried to find out some change from the history.
However, I saw that dpcm_lock never be held in dpcm_be_dai_trigger() from the beginning.
So, I just fixed some miss from the commit comment and resend.
If you have another suggestion or request, just let me know.
And I have a question.
This patch can’t be applied to stable branches directly by conflict.
I found out following commits are needed to apply this patch into the 5.4 stable.
ASoC: soc-pcm: remove snd_soc_dpcm_be_get/set_state()
ASoC: soc-pcm: add snd_soc_dpcm_can_be() and remove duplicate code
In this case, what should I do when stable maintainer requests resolving conflict to me?
Should I send those patches to the maintainer?
Or rewrite the patch on the latest of the each stable?
Thank you!
Gyeongtaek Lee
>
>Best regards
>---
>Kuninori Morimoto
>
Gyeongtaek Lee (1):
ASoC: dpcm: acquire dpcm_lock in dpcm_do_trigger()
sound/soc/soc-pcm.c | 62 ++++++++++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 18 deletions(-)
base-commit: fa02fcd94b0c8dff6cc65714510cf25ad194b90d
--
2.21.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2 0/1] ASoC: dpcm: acquire dpcm_lock in dpcm_do_trigger()
2020-12-03 5:32 ` [PATCH v2 0/1] ASoC: dpcm: acquire dpcm_lock in dpcm_do_trigger() Gyeongtaek Lee
@ 2020-12-03 7:02 ` Kuninori Morimoto
0 siblings, 0 replies; 2+ messages in thread
From: Kuninori Morimoto @ 2020-12-03 7:02 UTC (permalink / raw)
To: Gyeongtaek Lee
Cc: alsa-devel, khw0178.kim, 'Takashi Iwai',
'Pierre-Louis Bossart', lgirdwood, kimty, donggyun.ko,
hmseo, cpgs, s47.kang, pilsun.jang, tkjung
Hi Gyeongtaek
Thank you for your help
> I tried to find out some change from the history.
> However, I saw that dpcm_lock never be held in dpcm_be_dai_trigger() from the beginning.
> So, I just fixed some miss from the commit comment and resend.
> If you have another suggestion or request, just let me know.
OK, thanks.
I just thought it was related to recent (especially mine :) patch.
BYW, your posted v2 still doesn't have alignment on log.
Is it mailer issue ?
> And I have a question.
> This patch can’t be applied to stable branches directly by conflict.
> I found out following commits are needed to apply this patch into the 5.4 stable.
> ASoC: soc-pcm: remove snd_soc_dpcm_be_get/set_state()
> ASoC: soc-pcm: add snd_soc_dpcm_can_be() and remove duplicate code
> In this case, what should I do when stable maintainer requests resolving conflict to me?
> Should I send those patches to the maintainer?
> Or rewrite the patch on the latest of the each stable?
Mark, please help him
Thank you for your help !!
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-03 7:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20201203053224epcas2p1fa702ea12a9869f5c73ec60c760a3131@epcas2p1.samsung.com>
2020-12-03 5:32 ` [PATCH v2 0/1] ASoC: dpcm: acquire dpcm_lock in dpcm_do_trigger() Gyeongtaek Lee
2020-12-03 7:02 ` Kuninori Morimoto
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.