lkml.org 
[lkml]   [2021]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 2/9] ALSA: virtio: add virtio sound driver
On Thu, 25 Feb 2021 12:51:36 +0100,
Anton Yakovlev wrote:
>
> > Now I'm wondering whether it's safe to do that from this place.
> > Basically device_reprobe() unbinds the device that releases the full
> > resources once including the devm_* stuff. And this work itself is in
> > a part of devm allocated resource, so it'll be released there. That
> > said, we might hit use-after-free... This needs to be verified.
>
> It's safe. Suicide kernel workers are funny but possible things. Since
> the kernel itself (AFAIU) assumes such a situation and does not access
> the worker structure after the callback function call.

Indeed, process_one_work() in workqueue.c assures no access to the
work object after the callback. Then this must be fine. Good to
know!


thanks,

Takashi

\
 
 \ /
  Last update: 2021-02-25 13:10    [W:0.041 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site