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 virtiofsd: add vhost-user.json file 2020-01-23 16:41:36 +00:00
Makefile.objs virtiofsd: add seccomp whitelist 2020-01-23 16:41:37 +00:00
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 virtiofsd: Parse flag FUSE_WRITE_KILL_PRIV 2020-01-23 16:41:37 +00:00
fuse_i.h virtiofsd: Remove fuse.h and struct fuse_module 2020-02-21 12:53:17 +00:00
fuse_log.c virtiofsd: Fix common header and define for QEMU builds 2020-01-23 16:41:36 +00:00
fuse_log.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
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 virtiofsd: support nanosecond resolution for file timestamp 2020-01-23 16:41:37 +00:00
fuse_opt.c virtiofsd: Fix common header and define for QEMU builds 2020-01-23 16:41:36 +00:00
fuse_opt.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
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 virtiofsd: cleanup allocated resource in se 2020-01-23 16:41:37 +00:00
helper.c virtiofsd: Help message fix for 'seconds' 2020-02-21 12:53:17 +00:00
passthrough_helpers.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
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 virtiofsd: add --syslog command-line option 2020-01-23 16:41:37 +00:00