Re: [PATCH v2 8/8] ALSA: aloop: Support runtime change of snd_timer via info interface

From: Takashi Iwai
Date: Thu Nov 07 2019 - 03:06:30 EST


On Tue, 05 Nov 2019 15:32:18 +0100,
Andrew Gabbasov wrote:
>
> Show and change sound card timer source with read-write info
> file in proc filesystem. Initial string can still be set as
> module parameter.
>
> The timer source string value can be changed at any time,
> but it is latched by PCM substream open callback (the first one
> for a particular cable). At this point it is actually used, that
> is the string is parsed, and the timer is looked up and opened.
>
> The timer source is set for a loopback card (the same as initial
> setting by module parameter), but every cable uses the value,
> current at the moment of open.
>
> Setting the value to empty string switches the timer to jiffies.
>
> Signed-off-by: Andrew Gabbasov <andrew_gabbasov@xxxxxxxxxx>

Unfortunately the whole code here are racy. It may lead to a crash or
use-after-free easily. Some locking is needed definitely.


thanks,

Takashi