Re: [RFC v1 0/3] Address potential user-after-free on module unload

From: Miguel Ojeda
Date: Wed Feb 13 2019 - 20:11:57 EST


Hi Sven,

On Sun, Feb 10, 2019 at 7:05 PM Sven Van Asbroeck <thesven73@xxxxxxxxx> wrote:
>
> 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.

Indeed! Note that I didn't mean to say they are trivial issues or that
the solution is simply to replace cancel_delayed_work() with the
_sync() version in all cases -- only that it might be a good idea to
suggest its existence (instead of only suggesting devm_, because in
cases like drivers/auxdisplay/ht16k33.c it may be the simplest fix).

Cheers,
Miguel