virtiofsd: prevent FUSE_INIT/FUSE_DESTROY races
commitcdc497c6925be745bc895355bd4674a17a4b2a8b
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 1 Aug 2019 16:54:07 +0000 (1 17:54 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 23 Jan 2020 16:41:37 +0000 (23 16:41 +0000)
tree0b09a7b3ab63faacdc1b1c28ae9b269438d1c90e
parenta3d756c5aecccc4c0e51060a7e2f1c87bf8f1180
virtiofsd: prevent FUSE_INIT/FUSE_DESTROY races

When running with multiple threads it can be tricky to handle
FUSE_INIT/FUSE_DESTROY in parallel with other request types or in
parallel with themselves.  Serialize FUSE_INIT and FUSE_DESTROY so that
malicious clients cannot trigger race conditions.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/fuse_i.h
tools/virtiofsd/fuse_lowlevel.c