qemu-e2k/hw/pci
Alex Kompel a023b7ac62 hw/pci: use-after-free in pci_nic_init_nofail when nic device fails to initialize
object_property_set_bool(OBJECT(dev), true, "realized", &err) in
pci_nic_init_nofail may release the object if device fails to
initialize which leads to use-after-free in error handling block.
qdev_init_nofail does the same thing while holding the reference.

(gdb) run -net nic
qemu-system-x86_64: failed to find romfile "efi-e1000.rom"

Program received signal SIGSEGV, Segmentation fault.
object_unparent (obj=0x7fffe96a0010) at qom/object.c:440
440     in qom/object.c
(gdb) bt
<nd_table>, rootbus=0x5555567ed990, default_model=<optimized out>,
default_devaddr=<optimized out>) at hw/pci/pci.c:1812
pci_bus=0x5555567ed990) at hw/i386/pc.c:1634
pci_type=0x555555c1a523 "i440FX", host_type=0x555555ba564e
"i440FX-pcihost") at hw/i386/pc_piix.c:241
out>, envp=<optimized out>) at vl.c:4481

Signed-off-by: Alex Kompel <barbos@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2017-01-20 10:58:26 +08:00
..
Makefile.objs
msi.c
msix.c
pci_bridge.c
pci_host.c
pci-stub.c
pci.c hw/pci: use-after-free in pci_nic_init_nofail when nic device fails to initialize 2017-01-20 10:58:26 +08:00
pcie_aer.c pcie_aer: support configurable AER capa version 2017-01-10 07:02:52 +02:00
pcie_host.c
pcie_port.c
pcie.c virtio-pci: address space translation service (ATS) support 2017-01-10 05:56:59 +02:00
shpc.c
slotid_cap.c
trace-events trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00