libvirt/src/remote
Peter Krempa d7e9093502 qemu: Fix handling of passed FDs in remoteDispatchDomainFdAssociate
To ensure same behaviour when remote driver is or is not used we must
not steal the FDs and array holding them passed to qemuDomainFDAssociate
but rather duplicate them. At the same time the remote driver must close
and free them to prevent leak.

Pointed out by Coverity as FD leak on error path:

 *** CID 404348:  Resource leaks  (RESOURCE_LEAK)
 /src/remote/remote_daemon_dispatch.c: 7484 in remoteDispatchDomainFdAssociate()
 7478         rv = 0;
 7479
 7480      cleanup:
 7481         if (rv < 0)
 7482             virNetMessageSaveError(rerr);
 7483         virObjectUnref(dom);
 >>>     CID 404348:  Resource leaks  (RESOURCE_LEAK)
 >>>     Variable "fds" going out of scope leaks the storage it points to.
 7484         return rv;

Fixes: abd9025c2f
Fixes: f762f87534
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-01-10 15:54:52 +01:00
..
libvirtd-admin.socket.in util: drop support for obsolete systemd in RHEL-7 2022-02-17 12:35:42 +00:00
libvirtd-ro.socket.in util: drop support for obsolete systemd in RHEL-7 2022-02-17 12:35:42 +00:00
libvirtd-tcp.socket.in util: drop support for obsolete systemd in RHEL-7 2022-02-17 12:35:42 +00:00
libvirtd-tls.socket.in util: drop support for obsolete systemd in RHEL-7 2022-02-17 12:35:42 +00:00
libvirtd.aug.in daemon: add tcp_min_ssf option 2021-11-04 17:02:56 +01:00
libvirtd.conf.in remote: conf: Mention that 'virtproxyd' doesn't require the '--listen' flag 2022-07-13 09:28:04 +02:00
libvirtd.confd
libvirtd.init.in
libvirtd.libxl.logrotate.in
libvirtd.logrotate.in
libvirtd.lxc.logrotate.in
libvirtd.policy
libvirtd.qemu.logrotate.in
libvirtd.rules
libvirtd.sasl
libvirtd.service.in Remove Before=libvirt-guests.service from other services 2022-10-27 17:39:19 +02:00
libvirtd.socket.in util: drop support for obsolete systemd in RHEL-7 2022-02-17 12:35:42 +00:00
libvirtd.sysctl
lxc_protocol.x
meson.build meson: Use dicts to initialize cfg_data objects 2022-04-01 15:33:19 +02:00
qemu_protocol.x lib: Introduce 'virDomainQemuMonitorCommandWithFiles' 2022-03-01 13:29:49 +01:00
remote_daemon_config.c remote: remove unnecessary return value and if branch 2022-09-07 11:53:33 +02:00
remote_daemon_config.h remote: remove unnecessary return value and if branch 2022-09-07 11:53:33 +02:00
remote_daemon_dispatch.c qemu: Fix handling of passed FDs in remoteDispatchDomainFdAssociate 2023-01-10 15:54:52 +01:00
remote_daemon_dispatch.h remote: Remove unused includes 2022-06-16 06:43:57 +02:00
remote_daemon_stream.c remote: fix misspelling in the documation of 'daemonCreateClientStream' 2023-01-06 10:20:27 +01:00
remote_daemon_stream.h
remote_daemon.c lib: Use the same style in the 'struct option' 2022-11-22 10:15:11 +01:00
remote_daemon.h remote: Remove unused includes 2022-06-16 06:43:57 +02:00
remote_driver.c remote: fix double free of migration params on error 2023-01-10 08:26:27 -05:00
remote_driver.h
remote_protocol.x lib: Introduce virDomainFDAssociate API 2023-01-09 14:59:42 +01:00
remote_sockets.c remote: fix null string specifier argument in remoteProbeSessionDriverFromBinary 2022-05-26 10:14:46 +02:00
remote_sockets.h
remote_ssh_helper.c syntax-check: sc_avoid_write: Don't use blanket file exceptions 2022-02-15 09:32:23 +01:00
test_libvirtd.aug.in daemon: add tcp_min_ssf option 2021-11-04 17:02:56 +01:00
virt-guest-shutdown.target
virtproxyd.confd
virtproxyd.init.in
virtproxyd.service.in systemd: Use correct man page name in modular daemon service files 2022-02-01 13:20:11 +01:00