qemu-e2k/tools/virtiofsd
Philippe Mathieu-Daudé e1cd92d95c tools/virtiofsd/passthrough_ll: Fix double close()
On success, the fdopendir() call closes fd. Later on the error
path we try to close an already-closed fd. This can lead to
use-after-free. Fix by only closing the fd if the fdopendir()
call failed.

Cc: qemu-stable@nongnu.org
Fixes: b39bce121b (add dirp_map to hide lo_dirp pointers)
Reported-by: Coverity (CID 1421933 USE_AFTER_FREE)
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200321120654.7985-1-philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-03-25 12:31:38 +00:00
..
50-qemu-virtiofsd.json.in
buffer.c virtiofsd: use fuse_buf_writev to replace fuse_buf_write for better performance 2020-01-23 16:41:37 +00:00
fuse_common.h
fuse_i.h virtiofsd: Remove fuse.h and struct fuse_module 2020-02-21 12:53:17 +00:00
fuse_log.c
fuse_log.h
fuse_lowlevel.c tools/virtiofsd/fuse_lowlevel: Fix fuse_out_header::error value 2020-02-21 12:53:17 +00:00
fuse_lowlevel.h virtiofsd: Remove fuse_req_getgroups 2020-02-10 17:24:43 +00:00
fuse_misc.h
fuse_opt.c
fuse_opt.h
fuse_signals.c virtiofsd: convert more fprintf and perror to use fuse log infra 2020-01-23 16:41:37 +00:00
fuse_virtio.c virtiofsd: Fix xattr operations 2020-03-03 15:13:24 +00:00
fuse_virtio.h
helper.c virtiofsd: Help message fix for 'seconds' 2020-02-21 12:53:17 +00:00
Makefile.objs
passthrough_helpers.h
passthrough_ll.c tools/virtiofsd/passthrough_ll: Fix double close() 2020-03-25 12:31:38 +00:00
seccomp.c virtiofsd: Fix xattr operations 2020-03-03 15:13:24 +00:00
seccomp.h