Re: [RFC v1 0/3] Address potential user-after-free on module unload
From: Sven Van Asbroeck
Date: Sun Feb 10 2019 - 13:10:42 EST
Hi Miguel,
On Thu, Feb 7, 2019 at 11:30 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> Similarly, in drivers/auxdisplay/ht16k33.c, the cancel_delayed_work()
> is there, instead of cancel_delayed_work_sync(). Having the script
> suggest this change would be useful, too (i.e. instead of the devm_
> change, assuming the cancel_delayed_work() is already there).
>
For relatively straightforward problems, I'd say yes.
However, the problems flagged by this script are not trivial at all.
In many cases, the missing _sync is just a symptom of general
synchronization issues on disconnect(), and simply adding it
will not fix the problem. Sometimes, it's just a false positive.