Re: [PATCH v2] media: dvb_demux: fix potential TOCTOU race conditions
From: Gui-Dong Han
Date: Tue Jan 20 2026 - 07:46:58 EST
On Tue, Jan 20, 2026 at 8:38 PM Markus Elfring <Markus.Elfring@xxxxxx> wrote:
>
> …
> > Fix this by extending the lock scope.
> …
>
> How do you think about to increase the application of scope-based resource management?
> https://elixir.bootlin.com/linux/v6.19-rc5/source/include/linux/mutex.h#L253
I did not use scope-based resource management because it was
introduced into the kernel relatively recently. Since this patch fixes
a bug that has existed for a long time and needs to be backported to
older stable kernels, using standard mutex locking ensures better
compatibility and easier backporting.
> > This possible bug was found by our experimental static analysis tool,
> > which analyzes lock usage to detect TOCTOU issues.
>
> * Do you refer to any other source code analysis approach than LR-Miner?
>
> * Will any additional background information become more helpful here?
This is a new experimental static analysis tool we are developing.
There is no additional background information to share at this moment.
Thanks.