diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2019-08-01 17:54:07 +0100 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2020-01-23 16:41:37 +0000 |
commit | cdc497c6925be745bc895355bd4674a17a4b2a8b (patch) | |
tree | 0b09a7b3ab63faacdc1b1c28ae9b269438d1c90e /tools/virtiofsd/fuse_i.h | |
parent | a3d756c5aecccc4c0e51060a7e2f1c87bf8f1180 (diff) |
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>
Diffstat (limited to 'tools/virtiofsd/fuse_i.h')
-rw-r--r-- | tools/virtiofsd/fuse_i.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/virtiofsd/fuse_i.h b/tools/virtiofsd/fuse_i.h index a20854f1c4..1447d86866 100644 --- a/tools/virtiofsd/fuse_i.h +++ b/tools/virtiofsd/fuse_i.h @@ -61,6 +61,7 @@ struct fuse_session { struct fuse_req list; struct fuse_req interrupts; pthread_mutex_t lock; + pthread_rwlock_t init_rwlock; int got_destroy; int broken_splice_nonblock; uint64_t notify_ctr; |