Skip to content
Commit 69ef9bc5 authored by Miguel Ojeda's avatar Miguel Ojeda
Browse files

auxdisplay: ht16k33: fix potential user-after-free on module unload



On module unload/remove, we need to ensure that work does not run
after we have freed resources. Concretely, cancel_delayed_work()
may return while the callback function is still running.

From kernel/workqueue.c:

    The work callback function may still be running on return,
    unless it returns true and the work doesn't re-arm itself.
    Explicitly flush or use cancel_delayed_work_sync() to wait on it.

Link: https://lore.kernel.org/lkml/20190204220952.30761-1-TheSven73@googlemail.com/
Reported-by: default avatarSven Van Asbroeck <thesven73@gmail.com>
Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: default avatarSven Van Asbroeck <TheSven73@gmail.com>
Acked-by: default avatarRobin van der Gracht <robin@protonic.nl>
Signed-off-by: default avatarMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
parent 8834f560
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment