virtiofsd: prevent races with lo_dirp_put()
commitacefdde73b403576a241ebd8dbe8431ddc0d9442
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 26 Jul 2019 09:11:03 +0000 (26 10:11 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 23 Jan 2020 16:41:37 +0000 (23 16:41 +0000)
tree807c0e6b16c3852777b95ff85f8158fcffe24462
parentbaed65c060c0e524530bc243eec427fb408bd477
virtiofsd: prevent races with lo_dirp_put()

Introduce lo_dirp_put() so that FUSE_RELEASEDIR does not cause
use-after-free races with other threads that are accessing lo_dirp.

Also make lo_releasedir() atomic to prevent FUSE_RELEASEDIR racing with
itself.  This prevents double-frees.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/passthrough_ll.c