peripherals: 0.865 ppc: 0.823 x86: 0.814 hypervisor: 0.804 TCG: 0.803 user-level: 0.792 VMM: 0.787 vnc: 0.785 risc-v: 0.780 mistranslation: 0.778 KVM: 0.776 graphic: 0.774 register: 0.772 semantic: 0.757 i386: 0.757 device: 0.755 architecture: 0.745 performance: 0.742 permissions: 0.738 virtual: 0.735 debug: 0.727 arm: 0.706 network: 0.702 assembly: 0.698 socket: 0.688 PID: 0.687 kernel: 0.669 boot: 0.646 files: 0.619 virtio-net: Use-After-Free during unrealization of virtio-net Description of problem: When hotplugging `virtio-net` device, mishandling of `failover` option may leads to use-after-free. More specifically, if we try to hotplug virtio-net device with `failover=on` and other invalid option (e.g. `rx_queue_size=0`), the device listner callback is registered but not unregistered before being freed, leading to UAF. Steps to reproduce: ```sh cat <0x0c5c7fff9560: fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd 0x0c5c7fff9570: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c5c7fff9580: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c5c7fff9590: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c5c7fff95a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c5c7fff95b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==836681==ABORTING ``` #