libvirt/src/util
Erik Skultety 92e30a4dac mdev: Fix daemon crash on domain shutdown after reconnect
The problem resides in virHostdevUpdateActiveMediatedDevices which gets
called during qemuProcessReconnect. The issue here is that
virMediatedDeviceListAdd takes a pointer to the item to be added to the
list to which VIR_APPEND_ELEMENT is used, which also clears the pointer.
However, in this case only the local copy of the pointer got cleared,
leaving the original pointing to valid memory. To sum it up, during
cleanup phase, the original pointer is freed and the daemon crashes
basically any time it would access it.

Backtrace:
0x00007ffff3ccdeba in __strcmp_sse2_unaligned
0x00007ffff72a444a in virMediatedDeviceListFindIndex
0x00007ffff7241446 in virHostdevReAttachMediatedDevices
0x00007fffc60215d9 in qemuHostdevReAttachMediatedDevices
0x00007fffc60216dc in qemuHostdevReAttachDomainDevices
0x00007fffc6046e6f in qemuProcessStop
0x00007fffc6091596 in processMonitorEOFEvent
0x00007fffc6091793 in qemuProcessEventHandler
0x00007ffff7294bf5 in virThreadPoolWorker
0x00007ffff7294184 in virThreadHelper
0x00007ffff3fdc3c4 in start_thread () from /lib64/libpthread.so.0
0x00007ffff3d269cf in clone () from /lib64/libc.so.6

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1446455

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
2017-05-04 08:05:03 +02:00
..
iohelper.c iohelper: Remove unused mode 2017-04-28 14:17:10 +02:00
viralloc.c Use explicit boolean comparison in OOM check 2017-02-23 10:11:16 +00:00
viralloc.h util: Remove need for STATIC_ANALYSIS check 2016-05-19 16:30:04 -04:00
virarch.c
virarch.h
viratomic.c
viratomic.h
viraudit.c
viraudit.h
virauth.c
virauth.h
virauthconfig.c util: Fix broken syntax-check 2016-06-16 06:17:58 -04:00
virauthconfig.h
virbitmap.c util: Remove NONNULL(1) for virBitmapParseUnlimited 2017-03-22 13:49:59 -04:00
virbitmap.h util: Remove NONNULL(1) for virBitmapParseUnlimited 2017-03-22 13:49:59 -04:00
virbuffer.c util: buffer: Add API to set indentation level to a given value 2017-03-27 09:29:57 +02:00
virbuffer.h util: buffer: Add API to set indentation level to a given value 2017-03-27 09:29:57 +02:00
vircgroup.c cgroup: add virCgroupAddMachineTask stub for win32 2017-01-09 14:27:34 +00:00
vircgroup.h lxc: ensure libvirt_lxc and qemu-nbd move into systemd machine slice 2017-01-09 12:46:52 +00:00
vircgrouppriv.h
virclosecallbacks.c util: Fix domain object leaks on closecallbacks 2017-02-03 19:38:39 -05:00
virclosecallbacks.h Disallow inclusion of files from src/conf into src/utils 2017-02-20 15:12:07 +01:00
vircommand.c virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
vircommand.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
vircommandpriv.h
virconf.c virConfSaveValue: protect against a NULL pointer reference 2017-04-13 10:54:04 -06:00
virconf.h util: conf: Rename VIR_CONF_{U,}LONG -> VIR_CONF_{U,}LLONG 2016-07-18 15:49:57 +02:00
vircrypto.c Fix padding of encrypted data 2017-05-02 17:27:13 +01:00
vircrypto.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virdbus.c Fix typos and grammar 2016-11-23 12:08:15 -05:00
virdbus.h
virdbuspriv.h
virdnsmasq.c dnsmasq: disable IPv6 default gateway in RA for isolated networks 2016-07-13 13:49:03 +03:00
virdnsmasq.h dnsmasq: disable IPv6 default gateway in RA for isolated networks 2016-07-13 13:49:03 +03:00
virebtables.c
virebtables.h
virendian.h util: Introduce virReadBufInt16LE and virReadBufInt16BE 2016-06-24 13:23:02 -04:00
virerror.c virerror: add error for libssh transport 2016-11-15 15:50:51 +01:00
virerror.h
virevent.c
virevent.h
vireventpoll.c util: remove redundant comments 2016-06-16 13:09:19 -04:00
vireventpoll.h THREADS.txt: fix typos 2017-01-25 09:18:49 +01:00
virfdstream.c virfdstream: Drop iohelper in favour of a thread 2017-04-28 14:17:10 +02:00
virfdstream.h virfdstream: Drop iohelper in favour of a thread 2017-04-28 14:17:10 +02:00
virfile.c util: Add virStringTrimOptionalNewline 2017-04-07 08:49:34 +02:00
virfile.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virfirewall.c util: Turn virFirewallAddRule() into a macro 2017-01-04 11:14:56 +01:00
virfirewall.h util: Fix syntax-check 2017-01-04 12:47:01 +01:00
virfirewallpriv.h
virfirmware.c virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
virfirmware.h driver config: Introduce virFirmware object 2016-06-13 14:13:16 -06:00
virgettext.c
virgettext.h
virgic.c
virgic.h qemu: Probe GIC capabilities 2016-04-20 12:46:48 +02:00
virhash.c
virhash.h
virhashcode.c
virhashcode.h headers: Remove unnecessary keyword extern from function declaration 2016-05-11 09:06:32 +02:00
virhook.c libxl: add hooks support 2016-08-02 14:20:31 +02:00
virhook.h libxl: add hooks support 2016-08-02 14:20:31 +02:00
virhostcpu.c lib: Fix c99 style comments 2017-04-27 14:13:19 +02:00
virhostcpu.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virhostcpupriv.h util: Adapt virhostcpu to the new virsysfs 2017-03-27 13:13:29 +02:00
virhostdev.c mdev: Fix daemon crash on domain shutdown after reconnect 2017-05-04 08:05:03 +02:00
virhostdev.h util: Remove NONNULL from virHostdevReAttachMediatedDevices 2017-03-27 12:41:24 -04:00
virhostmem.c lib: Fix c99 style comments 2017-04-27 14:13:19 +02:00
virhostmem.h nodeinfo: move host memory APIs out into virhostmem file 2016-06-09 18:43:18 +01:00
viridentity.c src: Treat PID as signed 2016-10-13 17:58:56 +08:00
viridentity.h
virinitctl.c
virinitctl.h
viriptables.c
viriptables.h
viriscsi.c virISCSIGetSession: Don't leak memory 2017-04-05 15:18:30 +02:00
viriscsi.h util: Introduce virISCSINodeNew 2016-07-28 08:27:13 -04:00
virjson.c util: json: Make function to free JSON values in virHash universal 2017-03-27 10:35:19 +02:00
virjson.h util: json: Make function to free JSON values in virHash universal 2017-03-27 10:35:19 +02:00
virkeycode.c util: switch over to use keycodemapdb GIT submodule 2017-04-25 21:14:18 +01:00
virkeycode.h
virkeyfile.c
virkeyfile.h
virkmod.c
virkmod.h
virlease.c Don't drop expired lease while reading custom leases file 2016-10-05 08:33:59 +02:00
virlease.h
virlockspace.c
virlockspace.h
virlog.c admin: Throw a system error when 'open' fails on user-provided output 2017-03-31 12:07:07 +02:00
virlog.h admin: Allow passing NULL to virLogSetOutputs 2016-12-15 10:36:23 +01:00
virmacaddr.c util: make virMacAddrParse more versatile 2017-03-24 00:37:01 -04:00
virmacaddr.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virmacmap.c virmacmap: Don't use hash table dataFree callback 2017-01-02 13:05:34 +01:00
virmacmap.h util: Introduce virMACMap module 2016-12-06 13:33:18 +01:00
virmdev.c mdev: Fix daemon crash on domain shutdown after reconnect 2017-05-04 08:05:03 +02:00
virmdev.h mdev: Fix daemon crash on domain shutdown after reconnect 2017-05-04 08:05:03 +02:00
virnetdev.c util: relax virNetDevSetCoalesce() stub 2017-04-24 15:57:54 +04:00
virnetdev.h util: rename/move VIR_NET_GENERATED_PREFIX to be consistent 2017-04-28 09:43:52 -04:00
virnetdevbandwidth.c
virnetdevbandwidth.h util: Remove NONNULL(2) for virNetDevBandwidthPlug 2017-03-22 13:50:00 -04:00
virnetdevbridge.c virNetDevBridgeGet: Don't require users to virNetDevSetupControl 2016-06-02 11:35:29 +02:00
virnetdevbridge.h
virnetdevip.c IPv6 route check: list devices only once 2017-04-26 18:59:24 +02:00
virnetdevip.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virnetdevmacvlan.c util: make macvtap/macvlan generated name #defines available to other files 2017-04-28 09:43:52 -04:00
virnetdevmacvlan.h util: make macvtap/macvlan generated name #defines available to other files 2017-04-28 09:43:52 -04:00
virnetdevmidonet.c
virnetdevmidonet.h
virnetdevopenvswitch.c network: allow to specify timeout for openvswitch calls 2017-02-09 14:34:08 +01:00
virnetdevopenvswitch.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virnetdevtap.c Set coalesce settings for domain interfaces 2017-04-21 13:35:04 +02:00
virnetdevtap.h Set coalesce settings for domain interfaces 2017-04-21 13:35:04 +02:00
virnetdevveth.c
virnetdevveth.h
virnetdevvlan.c
virnetdevvlan.h
virnetdevvportprofile.c util: move virNetDevLinkDump to virnetlink.c 2016-06-26 19:33:07 -04:00
virnetdevvportprofile.h util: Remove NONNULL's for virNetDevVPortProfile[Associate|Disassociate] 2017-03-22 13:50:00 -04:00
virnetlink.c util: ignore -Wcast-align in virNetlinkDumpCommand 2017-04-04 12:53:23 +02:00
virnetlink.h util: add virNetlinkDumpCommand() 2017-03-22 09:01:32 +01:00
virnodesuspend.c util: Fix naming in util/virnodesuspend 2017-03-27 13:13:29 +02:00
virnodesuspend.h util: Fix naming in util/virnodesuspend 2017-03-27 13:13:29 +02:00
virnuma.c numa: Rename virNumaGetHostNodeset and make it return only nodes with memory 2016-09-14 08:41:41 +02:00
virnuma.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virobject.c
virobject.h
virpci.c util: Drop unused var @errbuf from virPCIGetDeviceAddressFromSysfsLink 2017-04-27 12:21:17 +02:00
virpci.h pci: recognize/report GEN4 (PCIe 4.0) card 16GT/s Link speed 2017-04-13 13:23:56 -04:00
virperf.c util: add missing equal sign in initialization 2017-04-13 14:02:46 +02:00
virperf.h perf: add emulation_faults software perf event support 2017-03-07 13:51:05 -05:00
virpidfile.c
virpidfile.h
virpolkit.c virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
virpolkit.h
virportallocator.c
virportallocator.h
virprobe.h
virprocess.c process: Translate "unlimited" correctly 2017-03-28 10:54:49 +02:00
virprocess.h lxc: Move lxcContainerAvailable to virprocess 2017-01-11 18:02:35 +01:00
virqemu.c util: virqemu: introduce virQEMUBuildBufferEscape 2017-02-24 12:58:48 +01:00
virqemu.h util: virqemu: introduce virQEMUBuildBufferEscape 2017-02-24 12:58:48 +01:00
virrandom.c util: Perform proper virRandomBytes return value checking 2016-06-07 10:18:36 -04:00
virrandom.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virrotatingfile.c util: Fix resource leak 2017-04-13 08:14:54 -04:00
virrotatingfile.h
virscsi.c util: Create a new virvhba module and move/rename API's 2017-02-19 06:45:09 -05:00
virscsi.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virscsihost.c util: Move scsi_host specific functions from virutil 2017-02-19 06:45:09 -05:00
virscsihost.h util: Move scsi_host specific functions from virutil 2017-02-19 06:45:09 -05:00
virscsivhost.c virscsivhost: Introduce virSCSIVHostDeviceGetPath 2016-12-15 09:25:16 +01:00
virscsivhost.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virseclabel.c
virseclabel.h
virsecret.c util: Introduce virSecretLookupFormatSecret 2016-06-23 12:30:28 -04:00
virsecret.h util: Introduce virSecretLookupFormatSecret 2016-06-23 12:30:28 -04:00
virsexpr.c
virsexpr.h
virsocketaddr.c util: Introduce virSocketAddrPTRDomain 2016-12-19 09:03:29 +01:00
virsocketaddr.h util: Introduce virSocketAddrPTRDomain 2016-12-19 09:03:29 +01:00
virstorageencryption.c virStorageEncryptionSecretFree: Don't leak secret lookup definition 2016-07-11 14:21:01 +02:00
virstorageencryption.h storage: Fix capacity value for LUKS encrypted volumes 2017-04-03 16:15:29 -04:00
virstoragefile.c virStorageSourceClear: Don't leave dangling pointers behind 2017-04-05 15:18:30 +02:00
virstoragefile.h util: storage: Add variables for node names into virStorageSource 2017-03-27 09:29:57 +02:00
virstring.c virstring: Introduce virStringListRemove 2016-12-06 13:33:18 +01:00
virstring.h util: Add virStringTrimOptionalNewline 2017-04-07 08:49:34 +02:00
virsysfs.c util: Add virStringTrimOptionalNewline 2017-04-07 08:49:34 +02:00
virsysfs.h util: Add virsysfs for handling sysfs files 2017-03-27 13:13:29 +02:00
virsysfspriv.h util: Add virsysfs for handling sysfs files 2017-03-27 13:13:29 +02:00
virsysinfo.c src: fix multiple resource leaks in loops 2017-04-11 13:23:00 +02:00
virsysinfo.h
virsysinfopriv.h tests: sysinfo: Export virSysinfoSetup via the private header 2017-03-07 10:44:26 +01:00
virsystemd.c util: systemd: Don't strlen a possibly NULL string 2017-04-12 10:55:42 +02:00
virsystemd.h
virsystemdpriv.h Cache the presence of machine1 service 2017-03-06 15:44:33 +01:00
virthread.c
virthread.h
virthreadjob.c
virthreadjob.h
virthreadpool.c admin: Introduce virAdmServerSetThreadPoolParameters 2016-04-18 17:07:46 +02:00
virthreadpool.h admin: Introduce virAdmServerSetThreadPoolParameters 2016-04-18 17:07:46 +02:00
virtime.c virTimeBackOffWait: Avoid long periods of sleep 2017-03-16 09:21:39 +01:00
virtime.h Add functions for handling exponential backoff loops. 2016-04-15 16:54:28 +01:00
virtpm.c
virtpm.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virtypedparam.c Fix typos and grammar 2016-11-23 12:08:15 -05:00
virtypedparam.h util: Remove NONNULL(1,3,4) from virTypedParamsFilter 2017-03-22 13:50:00 -04:00
viruri.c virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
viruri.h
virusb.c virusb: Introduce virUSBDeviceGetPath 2016-12-15 09:25:16 +01:00
virusb.h virusb: Introduce virUSBDeviceGetPath 2016-12-15 09:25:16 +01:00
virutil.c util: Rename virFileWaitForDevices 2017-03-15 21:17:47 -04:00
virutil.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
viruuid.c util: factor out reading file into preallocated buffer 2016-05-03 08:58:30 -04:00
viruuid.h annotate all mocked functions with noinline 2017-04-19 10:51:51 +01:00
virvhba.c util: virvhba: fix typo that breaks build on non-linux systems 2017-02-19 15:47:27 +01:00
virvhba.h util: Create a new virvhba module and move/rename API's 2017-02-19 06:45:09 -05:00
virxdrdefs.h
virxml.c util: Introduce virFileRewriteStr 2016-12-06 13:33:18 +01:00
virxml.h virxml: Add function to check if string contains some illegal chars 2016-10-20 18:49:22 +08:00