Re: [PATCH] ALSA: aloop: Fix peer runtime UAF during format-change stop

From: Cássio Gabriel Monteiro Pires

Date: Fri Apr 24 2026 - 08:14:47 EST


On 4/24/26 08:14, Takashi Iwai wrote:
> Do we need to complicate this handling? IOW, can it be simply be like
> below?
>
> if (stop_capture) {
> snd_pcm_stop(dpcm_capt->substream, SNDRV_PCM_STATE_DRAINING);
> if (atomic_dec_and_test(&cable->stop_count))
> wake_up(&cable->stop_wait);
> }

That makes sense.

The lifetime fix only needs the stop_count/stop_wait
serialization, so I can simplify the stop path as you suggested.

I'll respin and send a v2 patch.

--
Thanks,
Cássio

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature