mirror of https://gitlab.com/qemu-project/qemu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Consider the following nested setup: An L1 host uses some virtio device (e.g. virtio-keyboard) for the L2 guest, and this L2 guest passes this device through to the L3 guest. Since the L3 guest sees a virtio device, it might send virtio notifications to the QEMU in L2 for that device. But since the QEMU in L2 defined this device as vfio-ccw, the function handle_virtio_ccw_notify() cannot handle this and crashes: It calls virtio_ccw_get_vdev() that casts sch->driver_data into a VirtioCcwDevice, but since "sch" belongs to a vfio-ccw device, that driver_data rather points to a CcwDevice instead. So as soon as QEMU tries to use some VirtioCcwDevice specific data from that device, we've lost. We must not take virtio notifications for such devices. Thus fix the issue by adding a check to the handle_virtio_ccw_notify() handler to refuse all devices that are not our own virtio devices. Like in the other branches that detect wrong settings, we return -EINVAL from the function, which will later be placed in GPR2 to inform the guest about the error. Reviewed-by: Halil Pasic <pasic@linux.ibm.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Tested-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20251118174047.73103-1-thuth@redhat.com> |
2 weeks ago | |
|---|---|---|
| .. | ||
| 3270-ccw.c | 7 months ago | |
| Kconfig | 12 months ago | |
| ap-bridge.c | 7 months ago | |
| ap-device.c | 7 months ago | |
| ap-stub.c | 6 months ago | |
| ccw-device.c | 5 months ago | |
| ccw-device.h | 1 year ago | |
| cpu-topology.c | 6 months ago | |
| css-bridge.c | 7 months ago | |
| css.c | 8 months ago | |
| event-facility.c | 5 months ago | |
| ipl.c | 1 month ago | |
| ipl.h | 7 months ago | |
| meson.build | 5 months ago | |
| s390-ccw.c | 7 months ago | |
| s390-hypercall.c | 2 weeks ago | |
| s390-hypercall.h | 12 months ago | |
| s390-pci-bus.c | 2 months ago | |
| s390-pci-inst.c | 1 month ago | |
| s390-pci-kvm.c | 2 years ago | |
| s390-pci-vfio.c | 2 months ago | |
| s390-skeys-kvm.c | 7 months ago | |
| s390-skeys.c | 6 months ago | |
| s390-stattrib-kvm.c | 2 months ago | |
| s390-stattrib.c | 2 months ago | |
| s390-virtio-ccw.c | 1 month ago | |
| sclp.c | 1 month ago | |
| sclpcpi.c | 1 month ago | |
| sclpcpu.c | 7 months ago | |
| sclpquiesce.c | 7 months ago | |
| tod-kvm.c | 7 months ago | |
| tod-tcg.c | 7 months ago | |
| tod.c | 7 months ago | |
| trace-events | 1 year ago | |
| trace.h | 5 years ago | |
| vhost-scsi-ccw.c | 7 months ago | |
| vhost-user-fs-ccw.c | 7 months ago | |
| vhost-vsock-ccw.c | 7 months ago | |
| virtio-ccw-9p.c | 7 months ago | |
| virtio-ccw-balloon.c | 7 months ago | |
| virtio-ccw-blk.c | 7 months ago | |
| virtio-ccw-crypto.c | 7 months ago | |
| virtio-ccw-gpu.c | 7 months ago | |
| virtio-ccw-input.c | 7 months ago | |
| virtio-ccw-md-stubs.c | 12 months ago | |
| virtio-ccw-md.c | 7 months ago | |
| virtio-ccw-md.h | 12 months ago | |
| virtio-ccw-mem.c | 7 months ago | |
| virtio-ccw-mem.h | 12 months ago | |
| virtio-ccw-net.c | 7 months ago | |
| virtio-ccw-rng.c | 7 months ago | |
| virtio-ccw-scsi.c | 7 months ago | |
| virtio-ccw-serial.c | 7 months ago | |
| virtio-ccw.c | 1 month ago | |
| virtio-ccw.h | 1 year ago | |