pc,pci,virtio,crypto: bugfixes
[PULL 15/22] hw/i386/intel_iommu: Fix trivial endianness problems
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
After reading the guest memory with dma_memory_read(), we have to make sure that we byteswap the little endian data to the host's byte order.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/i386/intel_iommu.c +5 -0
@@ -756,6 +756,8 @@ static int vtd_get_pdire_from_pdir_table(dma_addr_t pasid_dir_base,return -VTD_FR_PASID_TABLE_INV ; } + pdire->val =le64_to_cpu (pdire->val); +return 0 ; }
@@ -780,6 +782,9 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s, pe, entry_size, MEMTXATTRS_UNSPECIFIED)) {return -VTD_FR_PASID_TABLE_INV ; } +for (size_t i =0 ; i <ARRAY_SIZE (pe->val); i++) { + pe->val[i] =le64_to_cpu (pe->val[i]); + }/* Do translation type check */ if (!vtd_pe_type_check (x86_iommu, pe)) {
Signature · 1 line
MST
The following changes since commit c167c80b463768e04a22fbe37ba6c53a4a08e41e:
Merge tag 'pull-request-2023-08-03' of https://gitlab.com/thuth/qemu into staging (2023-08-03 07:37:17 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to 15b11a1da6a4b7c6b8bb37883f52b544dee2b8fd:
cryptodev: Handle unexpected request to avoid crash (2023-08-03 16:16:17 -0400)
----------------------------------------------------------------
pc,pci,virtio,crypto: bugfixes
fixes all over the place.
----------------------------------------------------------------
David Edmondson (1):
hw/virtio: qmp: add RING_RESET to 'info virtio-status'
Eric Auger (2):
hw/virtio-iommu: Fix potential OOB access in virtio_iommu_handle_command()
virtio-iommu: Standardize granule extraction and formatting
Hanna Czenczek (1):
virtio: Fix packed virtqueue used_idx mask
Igor Mammedov (6):
tests: acpi: x86: whitelist expected blobs
x86: acpi: workaround Windows not handling name references in Package properly
tests: acpi: x86: update expected blobs
tests: acpi: whitelist expected blobs
acpi: x86: remove _ADR on host bridges
tests: acpi: update expected blobs
Li Feng (1):
vhost: fix the fd leak
Milan Zamazal (1):
hw/virtio: Add a protection against duplicate vu_scmi_stop calls
Peter Maydell (1):
hw/pci-bridge/cxl_upstream.c: Use g_new0() in build_cdat_table()
Thomas Huth (6):
hw/i386/intel_iommu: Fix trivial endianness problems hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntry hw/i386/intel_iommu: Fix struct VTDInvDescIEC on big endian hosts hw/i386/intel_iommu: Fix index calculation in vtd_interrupt_remap_msi() hw/i386/x86-iommu: Fix endianness issue in x86_iommu_irq_to_msi_message() include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hosts
Yuri Benditovich (1):
pci: do not respond config requests after PCI device eject
Zhenwei Pi (2):
virtio-crypto: verify src&dst buffer length for sym request
cryptodev: Handle unexpected request to avoid crash
hw/i386/intel_iommu_internal.h | 9 +++++ include/hw/i386/intel_iommu.h | 50 +++++++++++++------------- include/hw/i386/x86-iommu.h | 50 +++++++++++++------------- include/hw/virtio/vhost-user-scmi.h | 1 + backends/cryptodev.c | 10 ++++++ hw/i386/acpi-build.c | 11 +++--- hw/i386/intel_iommu.c | 23 +++++++----- hw/i386/x86-iommu.c | 2 +- hw/pci-bridge/cxl_upstream.c | 5 +-- hw/pci/pci_host.c | 15 ++++++-- hw/virtio/vhost-user-scmi.c | 7 ++++ hw/virtio/vhost.c | 2 ++ hw/virtio/virtio-crypto.c | 5 +++ hw/virtio/virtio-iommu.c | 12 ++++--- hw/virtio/virtio-qmp.c | 2 ++ hw/virtio/virtio.c | 2 +- tests/data/acpi/pc/DSDT | Bin 6488 -> 6830 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 6411 -> 6741 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 7813 -> 8155 bytes tests/data/acpi/pc/DSDT.bridge | Bin 12615 -> 13701 bytes tests/data/acpi/pc/DSDT.cphp | Bin 6952 -> 7294 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 8142 -> 8484 bytes tests/data/acpi/pc/DSDT.hpbridge | Bin 6451 -> 6781 bytes tests/data/acpi/pc/DSDT.hpbrroot | Bin 3343 -> 3337 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 6560 -> 6902 bytes tests/data/acpi/pc/DSDT.memhp | Bin 7847 -> 8189 bytes tests/data/acpi/pc/DSDT.nohpet | Bin 6346 -> 6688 bytes tests/data/acpi/pc/DSDT.numamem | Bin 6494 -> 6836 bytes tests/data/acpi/pc/DSDT.roothp | Bin 9873 -> 10623 bytes tests/data/acpi/q35/DSDT | Bin 8361 -> 8355 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 8378 -> 8372 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9686 -> 9680 bytes tests/data/acpi/q35/DSDT.acpihmat-noinitiator | Bin 8640 -> 8634 bytes tests/data/acpi/q35/DSDT.applesmc | Bin 8407 -> 8401 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11590 -> 11968 bytes tests/data/acpi/q35/DSDT.core-count2 | Bin 32501 -> 32495 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8825 -> 8819 bytes tests/data/acpi/q35/DSDT.cxl | Bin 9673 -> 9655 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 10015 -> 10009 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 8436 -> 8430 bytes tests/data/acpi/q35/DSDT.ipmismbus | Bin 8449 -> 8443 bytes tests/data/acpi/q35/DSDT.ivrs | Bin 8378 -> 8372 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9720 -> 9714 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 9491 -> 9485 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 12770 -> 13208 bytes tests/data/acpi/q35/DSDT.noacpihp | Bin 8241 -> 8235 bytes tests/data/acpi/q35/DSDT.nohpet | Bin 8219 -> 8213 bytes tests/data/acpi/q35/DSDT.numamem | Bin 8367 -> 8361 bytes tests/data/acpi/q35/DSDT.pvpanic-isa | Bin 8462 -> 8456 bytes tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8967 -> 8961 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 8993 -> 8987 bytes tests/data/acpi/q35/DSDT.viot | Bin 9470 -> 9464 bytes tests/data/acpi/q35/DSDT.xapic | Bin 35724 -> 35718 bytes 53 files changed, 132 insertions(+), 74 deletions(-)
[PULL 02/22] hw/pci-bridge/cxl_upstream.c: Use g_new0() in build_cdat_table()
From: Peter Maydell <[email protected]>
In build_cdat_table() we do:
*cdat_table = g_malloc0(sizeof(*cdat_table) * CXL_USP_CDAT_NUM_ENTRIES);
This is wrong because:
- cdat_table has type CDATSubHeader ***
- so *cdat_table has type CDATSubHeader **
- so the array we're allocating here should be items of type CDATSubHeader *
- but we pass sizeof(*cdat_table), which is sizeof(CDATSubHeader **), implying that we're allocating an array of CDATSubHeader **
It happens that sizeof(CDATSubHeader **) == sizeof(CDATSubHeader *) so nothing blows up, but this should be sizeof(**cdat_table).
Avoid this excessively hard-to-understand code by using g_new0() instead, which will do the type checking for us. While we're here, we can drop the useless check against failure, as g_malloc0() and g_new0() never fail.
This fixes Coverity issue CID 1508120.
Message-Id: <[email protected]>
--- hw/pci-bridge/cxl_upstream.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
hw/pci-bridge/cxl_upstream.c +1 -4
@@ -274,10 +274,7 @@ static int build_cdat_table(CDATSubHeader ***cdat_table, void *priv) }; } - *cdat_table =g_malloc0 (sizeof (*cdat_table) *CXL_USP_CDAT_NUM_ENTRIES ); -if (!*cdat_table) { -return -ENOMEM ; - } + *cdat_table = g_new0(CDATSubHeader *, CXL_USP_CDAT_NUM_ENTRIES);/* Header always at start of structure */ (*cdat_table)[CXL_USP_CDAT_SSLBIS_LAT ] =g_steal_pointer (&sslbis_latency);
Signature · 1 line
MST
[PULL 09/22] acpi: x86: remove _ADR on host bridges
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
ACPI spec (since 2.0a) says
"
A device object must contain either an _HID object or an _ADR object, but can contain both.
"
_ADR is used when device is attached to an ennumerable bus, however hostbridge is not and uses dedicated _HID for discovery, drop _ADR field.
It doesn't seem that having _ADR has a negative effects OSes manage to tolerate that, but there is no point of having it there. (only pc/q35 has it hostbridge description, while others (microvm/arm) don't)
Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 3 --- 1 file changed, 3 deletions(-)
hw/i386/acpi-build.c +0 -3
@@ -1464,7 +1464,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, sb_scope =aml_scope ("_SB" ); dev =aml_device ("PCI0" );aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (pcmc->pci_root_uid)));aml_append (dev,aml_pci_edsm ());aml_append (sb_scope, dev);
@@ -1479,7 +1478,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, dev =aml_device ("PCI0" );aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" )));aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (pcmc->pci_root_uid)));aml_append (dev,build_q35_osc_method (!pm->pcihp_bridge_en));aml_append (dev,aml_pci_edsm ());
@@ -1593,7 +1591,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,aml_append (pkg,aml_eisaid ("PNP0A08" ));aml_append (pkg,aml_eisaid ("PNP0A03" ));aml_append (dev,aml_name_decl ("_CID" , pkg)); -aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 )));build_cxl_osc_method (dev); }else if (pci_bus_is_express (bus)) {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" )));
Signature · 1 line
MST
[PULL 17/22] hw/i386/intel_iommu: Fix struct VTDInvDescIEC on big endian hosts
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
On big endian hosts, we need to reverse the bitfield order in the struct VTDInvDescIEC, just like it is already done for the other bitfields in the various structs of the intel-iommu device.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 9 +++++++++ 1 file changed, 9 insertions(+)
hw/i386/intel_iommu_internal.h +9 -0
@@ -321,12 +321,21 @@ typedef enum VTDFaultReason {/* Interrupt Entry Cache Invalidation Descriptor: VT-d 6.5.2.7. */ struct VTDInvDescIEC { +#if HOST_BIG_ENDIAN +uint64_t reserved_2:16 ; +uint64_t index:16 ;/* Start index to invalidate */ +uint64_t index_mask:5 ;/* 2^N for continuous int invalidation */ +uint64_t resved_1:22 ; +uint64_t granularity:1 ;/* If set, it's global IR invalidation */ +uint64_t type:4 ;/* Should always be 0x4 */ +#else uint32_t type:4 ;/* Should always be 0x4 */ uint32_t granularity:1 ;/* If set, it's global IR invalidation */ uint32_t resved_1:22 ;uint32_t index_mask:5 ;/* 2^N for continuous int invalidation */ uint32_t index:16 ;/* Start index to invalidate */ uint32_t reserved_2:16 ; +#endif };typedef struct VTDInvDescIEC VTDInvDescIEC ;
Signature · 1 line
MST
[PULL 19/22] hw/i386/x86-iommu: Fix endianness issue in x86_iommu_irq_to_msi_message()
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
The values in "msg" are assembled in host endian byte order (the other field are also not swapped), so we must not swap the __addr_head here.
Message-Id: <[email protected]>
--- hw/i386/x86-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/x86-iommu.c +1 -1
@@ -63,7 +63,7 @@ void x86_iommu_irq_to_msi_message(X86IOMMUIrq *irq, MSIMessage *msg_out) msg.redir_hint = irq->redir_hint; msg.dest = irq->dest; msg.__addr_hi = irq->dest &0xffffff00 ; - msg.__addr_head =cpu_to_le32 (0xfee ); + msg.__addr_head =0xfee ;/* Keep this from original MSI address bits */ msg.__not_used = irq->msi_addr_last_bits;
Signature · 1 line
MST
[PULL 16/22] hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntry
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
The code already tries to do some endianness handling here, but currently fails badly:
- While it already swaps the data when logging errors / tracing, it fails to byteswap the value before e.g. accessing entry->irte.present
- entry->irte.source_id is swapped with le32_to_cpu(), though this is a 16-bit value
- The whole union is apparently supposed to be swapped via the 64-bit data[2] array, but the struct is a mixture between 32 bit values (the first 8 bytes) and 64 bit values (the second 8 bytes), so this cannot work as expected.
Fix it by converting the struct to two proper 64-bit bitfields, and by swapping the values only once for everybody right after reading the data from memory.
Message-Id: <[email protected]>
--- include/hw/i386/intel_iommu.h | 50 ++++++++++++++++++----------------- hw/i386/intel_iommu.c | 16 +++++------ 2 files changed, 34 insertions(+), 32 deletions(-)
include/hw/i386/intel_iommu.h +26 -24
@@ -178,37 +178,39 @@ enum {union VTD_IR_TableEntry {struct {#if HOST_BIG_ENDIAN -uint32_t __reserved_1:8 ;/* Reserved 1 */ -uint32_t vector:8 ;/* Interrupt Vector */ -uint32_t irte_mode:1 ;/* IRTE Mode */ -uint32_t __reserved_0:3 ;/* Reserved 0 */ -uint32_t __avail:4 ;/* Available spaces for software */ -uint32_t delivery_mode:3 ;/* Delivery Mode */ -uint32_t trigger_mode:1 ;/* Trigger Mode */ -uint32_t redir_hint:1 ;/* Redirection Hint */ -uint32_t dest_mode:1 ;/* Destination Mode */ -uint32_t fault_disable:1 ;/* Fault Processing Disable */ -uint32_t present:1 ;/* Whether entry present/available */ +uint64_t dest_id:32 ;/* Destination ID */ +uint64_t __reserved_1:8 ;/* Reserved 1 */ +uint64_t vector:8 ;/* Interrupt Vector */ +uint64_t irte_mode:1 ;/* IRTE Mode */ +uint64_t __reserved_0:3 ;/* Reserved 0 */ +uint64_t __avail:4 ;/* Available spaces for software */ +uint64_t delivery_mode:3 ;/* Delivery Mode */ +uint64_t trigger_mode:1 ;/* Trigger Mode */ +uint64_t redir_hint:1 ;/* Redirection Hint */ +uint64_t dest_mode:1 ;/* Destination Mode */ +uint64_t fault_disable:1 ;/* Fault Processing Disable */ +uint64_t present:1 ;/* Whether entry present/available */ #else -uint32_t present:1 ;/* Whether entry present/available */ -uint32_t fault_disable:1 ;/* Fault Processing Disable */ -uint32_t dest_mode:1 ;/* Destination Mode */ -uint32_t redir_hint:1 ;/* Redirection Hint */ -uint32_t trigger_mode:1 ;/* Trigger Mode */ -uint32_t delivery_mode:3 ;/* Delivery Mode */ -uint32_t __avail:4 ;/* Available spaces for software */ -uint32_t __reserved_0:3 ;/* Reserved 0 */ -uint32_t irte_mode:1 ;/* IRTE Mode */ -uint32_t vector:8 ;/* Interrupt Vector */ -uint32_t __reserved_1:8 ;/* Reserved 1 */ +uint64_t present:1 ;/* Whether entry present/available */ +uint64_t fault_disable:1 ;/* Fault Processing Disable */ +uint64_t dest_mode:1 ;/* Destination Mode */ +uint64_t redir_hint:1 ;/* Redirection Hint */ +uint64_t trigger_mode:1 ;/* Trigger Mode */ +uint64_t delivery_mode:3 ;/* Delivery Mode */ +uint64_t __avail:4 ;/* Available spaces for software */ +uint64_t __reserved_0:3 ;/* Reserved 0 */ +uint64_t irte_mode:1 ;/* IRTE Mode */ +uint64_t vector:8 ;/* Interrupt Vector */ +uint64_t __reserved_1:8 ;/* Reserved 1 */ +uint64_t dest_id:32 ;/* Destination ID */ #endif -uint32_t dest_id;/* Destination ID */ -uint16_t source_id;/* Source-ID */ #if HOST_BIG_ENDIAN uint64_t __reserved_2:44 ;/* Reserved 2 */ uint64_t sid_vtype:2 ;/* Source-ID Validation Type */ uint64_t sid_q:2 ;/* Source-ID Qualifier */ +uint64_t source_id:16 ;/* Source-ID */ #else +uint64_t source_id:16 ;/* Source-ID */ uint64_t sid_q:2 ;/* Source-ID Qualifier */ uint64_t sid_vtype:2 ;/* Source-ID Validation Type */ uint64_t __reserved_2:44 ;/* Reserved 2 */
hw/i386/intel_iommu.c +8 -8
@@ -3328,14 +3328,15 @@ static int vtd_irte_get(IntelIOMMUState *iommu, uint16_t index,return -VTD_FR_IR_ROOT_INVAL ; } -trace_vtd_ir_irte_get (index,le64_to_cpu (entry->data[1 ]), -le64_to_cpu (entry->data[0 ])); + entry->data[0 ] =le64_to_cpu (entry->data[0 ]); + entry->data[1 ] =le64_to_cpu (entry->data[1 ]); + +trace_vtd_ir_irte_get (index, entry->data[1 ], entry->data[0 ]);if (!entry->irte.present) {error_report_once ("%s: detected non-present IRTE " "(index=%u, high=0x%" PRIx64", low=0x%" PRIx64")" , - __func__, index,le64_to_cpu (entry->data[1 ]), -le64_to_cpu (entry->data[0 ])); + __func__, index, entry->data[1 ], entry->data[0 ]);return -VTD_FR_IR_ENTRY_P ; }
@@ -3343,14 +3344,13 @@ static int vtd_irte_get(IntelIOMMUState *iommu, uint16_t index, entry->irte.__reserved_2) {error_report_once ("%s: detected non-zero reserved IRTE " "(index=%u, high=0x%" PRIx64", low=0x%" PRIx64")" , - __func__, index,le64_to_cpu (entry->data[1 ]), -le64_to_cpu (entry->data[0 ])); + __func__, index, entry->data[1 ], entry->data[0 ]);return -VTD_FR_IR_IRTE_RSVD ; }if (sid !=X86_IOMMU_SID_INVALID ) {/* Validate IRTE SID */ - source_id =le32_to_cpu (entry->irte.source_id); + source_id = entry->irte.source_id;switch (entry->irte.sid_vtype) {case VTD_SVT_NONE :break ;
@@ -3404,7 +3404,7 @@ static int vtd_remap_irq_get(IntelIOMMUState *iommu, uint16_t index, irq->trigger_mode = irte.irte.trigger_mode; irq->vector = irte.irte.vector; irq->delivery_mode = irte.irte.delivery_mode; - irq->dest =le32_to_cpu (irte.irte.dest_id); + irq->dest = irte.irte.dest_id;if (!iommu->intr_eime) {#define VTD_IR_APIC_DEST_MASK (0xff00ULL)#define VTD_IR_APIC_DEST_SHIFT (8)
Signature · 1 line
MST
[PULL 18/22] hw/i386/intel_iommu: Fix index calculation in vtd_interrupt_remap_msi()
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
The values in "addr" are populated locally in this function in host endian byte order, so we must not swap the index_l field here.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/intel_iommu.c +1 -1
@@ -3459,7 +3459,7 @@ static int vtd_interrupt_remap_msi(IntelIOMMUState *iommu, goto out; } - index = addr.addr.index_h <<15 |le16_to_cpu (addr.addr.index_l); + index = addr.addr.index_h <<15 | addr.addr.index_l;#define VTD_IR_MSI_DATA_SUBHANDLE (0x0000ffff)#define VTD_IR_MSI_DATA_RESERVED (0xffff0000)
Signature · 1 line
MST
[PULL 22/22] cryptodev: Handle unexpected request to avoid crash
In reply to Michael S. TsirkinFrom: zhenwei pi <[email protected]>
Generally guest side should discover which services the device is able to offer, then do requests on device.
However it's also possible to break this rule in a guest. Handle unexpected request here to avoid NULL pointer dereference.
Message-Id: <[email protected]>
--- backends/cryptodev.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
backends/cryptodev.c +10 -0
@@ -191,6 +191,11 @@ static int cryptodev_backend_account(CryptoDevBackend *backend,if (algtype ==QCRYPTODEV_BACKEND_ALG_ASYM ) {CryptoDevBackendAsymOpInfo *asym_op_info = op_info->u.asym_op_info; len = asym_op_info->src_len; + +if (unlikely (!backend->asym_stat)) { +error_report ("cryptodev: Unexpected asym operation" ); +return -VIRTIO_CRYPTO_NOTSUPP ; + }switch (op_info->op_code) {case VIRTIO_CRYPTO_AKCIPHER_ENCRYPT :CryptodevAsymStatIncEncrypt (backend, len);
@@ -210,6 +215,11 @@ static int cryptodev_backend_account(CryptoDevBackend *backend, }else if (algtype ==QCRYPTODEV_BACKEND_ALG_SYM ) {CryptoDevBackendSymOpInfo *sym_op_info = op_info->u.sym_op_info; len = sym_op_info->src_len; + +if (unlikely (!backend->sym_stat)) { +error_report ("cryptodev: Unexpected sym operation" ); +return -VIRTIO_CRYPTO_NOTSUPP ; + }switch (op_info->op_code) {case VIRTIO_CRYPTO_CIPHER_ENCRYPT :CryptodevSymStatIncEncrypt (backend, len);
Signature · 1 line
MST
[PULL 01/22] hw/virtio-iommu: Fix potential OOB access in virtio_iommu_handle_command()
In reply to Michael S. TsirkinFrom: Eric Auger <[email protected]>
In the virtio_iommu_handle_command() when a PROBE request is handled, output_size takes a value greater than the tail size and on a subsequent iteration we can get a stack out-of-band access. Initialize the output_size on each iteration.
The issue was found with ASAN. Credits to:
Yiming Tao(Zhejiang University)
Gaoning Pan(Zhejiang University)
Message-Id: <[email protected]>
--- hw/virtio/virtio-iommu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/virtio/virtio-iommu.c +3 -1
@@ -728,13 +728,15 @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq)VirtIOIOMMU *s =VIRTIO_IOMMU (vdev);struct virtio_iommu_req_head head;struct virtio_iommu_req_tail tail = {}; -size_t output_size =sizeof (tail), sz;VirtQueueElement *elem;unsigned int iov_cnt;struct iovec *iov;void *buf =NULL ; +size_t sz;for (;;) { +size_t output_size =sizeof (tail); + elem =virtqueue_pop (vq,sizeof (VirtQueueElement));if (!elem) {return ;
Signature · 1 line
MST
[PULL 11/22] hw/virtio: qmp: add RING_RESET to 'info virtio-status'
In reply to Michael S. TsirkinFrom: David Edmondson <[email protected]>
Message-Id: <[email protected]>
--- hw/virtio/virtio-qmp.c | 2 ++ 1 file changed, 2 insertions(+)
hw/virtio/virtio-qmp.c +2 -0
@@ -79,6 +79,8 @@ static const qmp_virtio_feature_map_t virtio_transport_map[] = { "VIRTIO_F_ORDER_PLATFORM: Memory accesses ordered by platform"),FEATURE_ENTRY (VIRTIO_F_SR_IOV , \"VIRTIO_F_SR_IOV: Device supports single root I/O virtualization" ), +FEATURE_ENTRY (VIRTIO_F_RING_RESET , \ +"VIRTIO_F_RING_RESET: Driver can reset a queue individually" ),/* Virtio ring transport features */ FEATURE_ENTRY (VIRTIO_RING_F_INDIRECT_DESC , \ "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported"),
Signature · 1 line
MST
[PULL 20/22] include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hosts
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
The first bitfield here is supposed to be used as a 64-bit equivalent to the "uint64_t msi_addr" in the union. To make this work correctly on big endian hosts, too, the __addr_hi field has to be part of the bitfield, and the the bitfield members must be declared with "uint64_t" instead of "uint32_t" - otherwise the values are placed in the wrong bytes on big endian hosts.
Same applies to the 32-bit "msi_data" field: __resved1 must be part of the bitfield, and the members must be declared with "uint32_t" instead of "uint16_t".
Message-Id: <[email protected]>
--- include/hw/i386/x86-iommu.h | 50 +++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-)
include/hw/i386/x86-iommu.h +26 -24
@@ -87,40 +87,42 @@ struct X86IOMMU_MSIMessage {union {struct {#if HOST_BIG_ENDIAN -uint32_t __addr_head:12 ;/* 0xfee */ -uint32_t dest:8 ; -uint32_t __reserved:8 ; -uint32_t redir_hint:1 ; -uint32_t dest_mode:1 ; -uint32_t __not_used:2 ; +uint64_t __addr_hi:32 ; +uint64_t __addr_head:12 ;/* 0xfee */ +uint64_t dest:8 ; +uint64_t __reserved:8 ; +uint64_t redir_hint:1 ; +uint64_t dest_mode:1 ; +uint64_t __not_used:2 ;#else -uint32_t __not_used:2 ; -uint32_t dest_mode:1 ; -uint32_t redir_hint:1 ; -uint32_t __reserved:8 ; -uint32_t dest:8 ; -uint32_t __addr_head:12 ;/* 0xfee */ +uint64_t __not_used:2 ; +uint64_t dest_mode:1 ; +uint64_t redir_hint:1 ; +uint64_t __reserved:8 ; +uint64_t dest:8 ; +uint64_t __addr_head:12 ;/* 0xfee */ +uint64_t __addr_hi:32 ;#endif -uint32_t __addr_hi; } QEMU_PACKED;uint64_t msi_addr; };union {struct {#if HOST_BIG_ENDIAN -uint16_t trigger_mode:1 ; -uint16_t level:1 ; -uint16_t __resved:3 ; -uint16_t delivery_mode:3 ; -uint16_t vector:8 ; +uint32_t __resved1:16 ; +uint32_t trigger_mode:1 ; +uint32_t level:1 ; +uint32_t __resved:3 ; +uint32_t delivery_mode:3 ; +uint32_t vector:8 ;#else -uint16_t vector:8 ; -uint16_t delivery_mode:3 ; -uint16_t __resved:3 ; -uint16_t level:1 ; -uint16_t trigger_mode:1 ; +uint32_t vector:8 ; +uint32_t delivery_mode:3 ; +uint32_t __resved:3 ; +uint32_t level:1 ; +uint32_t trigger_mode:1 ; +uint32_t __resved1:16 ;#endif -uint16_t __resved1; } QEMU_PACKED;uint32_t msi_data; };
Signature · 1 line
MST
[PULL 08/22] tests: acpi: whitelist expected blobs
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +37 -0
@@ -1 +1,38 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT" , +"tests/data/acpi/pc/DSDT.acpierst" , +"tests/data/acpi/pc/DSDT.acpihmat" , +"tests/data/acpi/pc/DSDT.bridge" , +"tests/data/acpi/pc/DSDT.cphp" , +"tests/data/acpi/pc/DSDT.dimmpxm" , +"tests/data/acpi/pc/DSDT.hpbridge" , +"tests/data/acpi/pc/DSDT.hpbrroot" , +"tests/data/acpi/pc/DSDT.ipmikcs" , +"tests/data/acpi/pc/DSDT.memhp" , +"tests/data/acpi/pc/DSDT.nohpet" , +"tests/data/acpi/pc/DSDT.numamem" , +"tests/data/acpi/pc/DSDT.roothp" , +"tests/data/acpi/q35/DSDT" , +"tests/data/acpi/q35/DSDT.acpierst" , +"tests/data/acpi/q35/DSDT.acpihmat" , +"tests/data/acpi/q35/DSDT.acpihmat-noinitiator" , +"tests/data/acpi/q35/DSDT.applesmc" , +"tests/data/acpi/q35/DSDT.bridge" , +"tests/data/acpi/q35/DSDT.core-count2" , +"tests/data/acpi/q35/DSDT.cphp" , +"tests/data/acpi/q35/DSDT.cxl" , +"tests/data/acpi/q35/DSDT.dimmpxm" , +"tests/data/acpi/q35/DSDT.ipmibt" , +"tests/data/acpi/q35/DSDT.ipmismbus" , +"tests/data/acpi/q35/DSDT.ivrs" , +"tests/data/acpi/q35/DSDT.memhp" , +"tests/data/acpi/q35/DSDT.mmio64" , +"tests/data/acpi/q35/DSDT.multi-bridge" , +"tests/data/acpi/q35/DSDT.noacpihp" , +"tests/data/acpi/q35/DSDT.nohpet" , +"tests/data/acpi/q35/DSDT.numamem" , +"tests/data/acpi/q35/DSDT.pvpanic-isa" , +"tests/data/acpi/q35/DSDT.tis.tpm12" , +"tests/data/acpi/q35/DSDT.tis.tpm2" , +"tests/data/acpi/q35/DSDT.viot" , +"tests/data/acpi/q35/DSDT.xapic",
Signature · 1 line
MST
[PULL 06/22] x86: acpi: workaround Windows not handling name references in Package properly
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
it seems that Windows is unable to handle variable references
making it choke up when accessing ASUN during _DSM call
when device is hotplugged (it lists package elements as DataAlias
but despite that later on it misbehaves) with following error
shown up in AMLI debugger (WS2012r2):
Store(ShiftLeft(One,Arg1="ASUN",) AMLI_ERROR(c0140008): Unexpected argument type
ValidateArgTypes: expected Arg1 to be type Integer (Type=String)
Similar outcome with WS2022.
Issue is not fatal but as result acpi-index/"PCI Label ID" property is either not shown in device details page or shows incorrect value.
Fix it by doing assignment of BSEL/ASUN values to package elements manually after package declaration.
Fix was tested with: WS2012r2, WS2022, RHEL9
Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
hw/i386/acpi-build.c +6 -2
@@ -362,9 +362,13 @@ Aml *aml_pci_device_dsm(void) {Aml *params =aml_local (0 );Aml *pkg =aml_package (2 ); -aml_append (pkg,aml_name ("BSEL" )); -aml_append (pkg,aml_name ("ASUN" )); +aml_append (pkg,aml_int (0 )); +aml_append (pkg,aml_int (0 ));aml_append (method,aml_store (pkg, params)); +aml_append (method, +aml_store (aml_name ("BSEL" ),aml_index (params,aml_int (0 )))); +aml_append (method, +aml_store (aml_name ("ASUN" ),aml_index (params,aml_int (1 ))));aml_append (method,aml_return (aml_call5 ("PDSM" ,aml_arg (0 ),aml_arg (1 ), aml_arg(2), aml_arg(3), params))
Signature · 1 line
MST
[PULL 14/22] vhost: fix the fd leak
In reply to Michael S. TsirkinFrom: Li Feng <[email protected]>
When the vhost-user reconnect to the backend, the notifer should be cleanup. Otherwise, the fd resource will be exhausted.
Message-Id: <[email protected]>
--- hw/virtio/vhost.c | 2 ++ 1 file changed, 2 insertions(+)
hw/virtio/vhost.c +2 -0
@@ -2044,6 +2044,8 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings)event_notifier_test_and_clear ( &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR ].masked_config_notifier);event_notifier_test_and_clear (&vdev->config_notifier); +event_notifier_cleanup ( + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR ].masked_config_notifier);trace_vhost_dev_stop (hdev, vdev->name, vrings);
Signature · 1 line
MST
[PULL 03/22] virtio-iommu: Standardize granule extraction and formatting
In reply to Michael S. TsirkinFrom: Eric Auger <[email protected]>
At several locations we compute the granule from the config page_size_mask using ctz() and then format it in traces using BIT(). As the page_size_mask is 64b we should use ctz64 and BIT_ULL() for formatting. We failed to be consistent.
Note the page_size_mask is garanteed to be non null. The spec mandates the device to set at least one bit, so ctz64 cannot return 64. This is garanteed by the fact the device initializes the page_size_mask to qemu_target_page_mask() and then the page_size_mask is further constrained by virtio_iommu_set_page_size_mask() callback which can't result in a new mask being null. So if Coverity complains round those ctz64/BIT_ULL with CID 1517772 this is a false positive
Message-Id: <[email protected]>
--- hw/virtio/virtio-iommu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
hw/virtio/virtio-iommu.c +5 -3
@@ -854,17 +854,19 @@ static IOMMUTLBEntry virtio_iommu_translate(IOMMUMemoryRegion *mr, hwaddr addr,VirtIOIOMMUEndpoint *ep;uint32_t sid, flags;bool bypass_allowed; +int granule;bool found;int i; interval.low = addr; interval.high = addr +1 ; + granule =ctz64 (s->config.page_size_mask);IOMMUTLBEntry entry = { .target_as = &address_space_memory, .iova = addr, .translated_addr = addr, - .addr_mask = (1 <<ctz32 (s->config.page_size_mask)) -1 , + .addr_mask =BIT_ULL (granule) -1 , .perm =IOMMU_NONE , };
@@ -1117,7 +1119,7 @@ static int virtio_iommu_set_page_size_mask(IOMMUMemoryRegion *mr,if (s->granule_frozen) {int cur_granule =ctz64 (cur_mask); -if (!(BIT (cur_granule) & new_mask)) { +if (!(BIT_ULL (cur_granule) & new_mask)) {error_setg (errp,"virtio-iommu %s does not support frozen granule 0x%llx" , mr->parent_obj.name,BIT_ULL (cur_granule));return -1 ;
@@ -1163,7 +1165,7 @@ static void virtio_iommu_freeze_granule(Notifier *notifier, void *data) } s->granule_frozen = true; granule =ctz64 (s->config.page_size_mask); -trace_virtio_iommu_freeze_granule (BIT (granule)); +trace_virtio_iommu_freeze_granule (BIT_ULL (granule)); }static void virtio_iommu_device_realize (DeviceState *dev,Error **errp)
Signature · 1 line
MST
[PULL 05/22] tests: acpi: x86: whitelist expected blobs
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +14 -0
@@ -1 +1,15 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT" , +"tests/data/acpi/pc/DSDT.acpierst" , +"tests/data/acpi/pc/DSDT.acpihmat" , +"tests/data/acpi/pc/DSDT.bridge" , +"tests/data/acpi/pc/DSDT.cphp" , +"tests/data/acpi/pc/DSDT.dimmpxm" , +"tests/data/acpi/pc/DSDT.hpbridge" , +"tests/data/acpi/pc/DSDT.ipmikcs" , +"tests/data/acpi/pc/DSDT.memhp" , +"tests/data/acpi/pc/DSDT.nohpet" , +"tests/data/acpi/pc/DSDT.numamem" , +"tests/data/acpi/pc/DSDT.roothp" , +"tests/data/acpi/q35/DSDT.bridge" , +"tests/data/acpi/q35/DSDT.multi-bridge",
Signature · 1 line
MST
[PULL 04/22] hw/virtio: Add a protection against duplicate vu_scmi_stop calls
In reply to Michael S. TsirkinFrom: Milan Zamazal <[email protected]>
The QEMU CI fails in virtio-scmi test occasionally. As reported by Thomas Huth, this happens most likely when the system is loaded and it fails with the following error:
qemu-system-aarch64: ../../devel/qemu/hw/pci/msix.c:659:
msix_unset_vector_notifiers: Assertion `dev->msix_vector_use_notifier && dev->msix_vector_release_notifier' failed. ../../devel/qemu/tests/qtest/libqtest.c:200: kill_qemu() detected QEMU death from signal 6 (Aborted) (core dumped)
As discovered by Fabiano Rosas, the cause is a duplicate invocation of msix_unset_vector_notifiers via duplicate vu_scmi_stop calls:
msix_unset_vector_notifiers
virtio_pci_set_guest_notifiers
vu_scmi_stop
vu_scmi_disconnect
...
qemu_chr_write_buffer
msix_unset_vector_notifiers
virtio_pci_set_guest_notifiers
vu_scmi_stop
vu_scmi_set_status
...
qemu_cleanup
While vu_scmi_stop calls are protected by vhost_dev_is_started() check, it's apparently not enough. vhost-user-blk and vhost-user-gpio use an extra protection, see f5b22d06fb (vhost: recheck dev state in the vhost_migration_log routine) for the motivation. Let's use the same in vhost-user-scmi, which fixes the failure above.
Message-Id: <[email protected]>
--- include/hw/virtio/vhost-user-scmi.h | 1 + hw/virtio/vhost-user-scmi.c | 7 +++++++ 2 files changed, 8 insertions(+)
include/hw/virtio/vhost-user-scmi.h +1 -0
@@ -25,6 +25,7 @@ struct VHostUserSCMI {VirtQueue *cmd_vq;VirtQueue *event_vq;bool connected; + bool started_vu; };#endif /* _QEMU_VHOST_USER_SCMI_H */
hw/virtio/vhost-user-scmi.c +7 -0
@@ -63,6 +63,7 @@ static int vu_scmi_start(VirtIODevice *vdev)error_report ("Error starting vhost-user-scmi: %d" , ret); goto err_guest_notifiers; } + scmi->started_vu = true;/* * guest_notifier_mask/pending not used yet, so just unmask
@@ -90,6 +91,12 @@ static void vu_scmi_stop(VirtIODevice *vdev)struct vhost_dev *vhost_dev = &scmi->vhost_dev;int ret; +/* vhost_dev_is_started() check in the callers is not fully reliable. */ +if (!scmi->started_vu) { +return ; + } + scmi->started_vu = false; +if (!k->set_guest_notifiers) {return ; }
Signature · 1 line
MST
[PULL 13/22] pci: do not respond config requests after PCI device eject
In reply to Michael S. TsirkinFrom: Yuri Benditovich <[email protected]>
In migration with VF failover, Windows guest and ACPI hot unplug we do not need to satisfy config requests, otherwise the guest immediately detects the device and brings up its driver. Many network VF's are stuck on the guest PCI bus after the migration.
Message-Id: <[email protected]>
--- hw/pci/pci_host.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
hw/pci/pci_host.c +13 -2
@@ -62,6 +62,17 @@ static void pci_adjust_config_limit(PCIBus *bus, uint32_t *limit) } } +static bool is_pci_dev_ejected (PCIDevice *pci_dev) +{ +/* +* device unplug was requested and the guest acked it, +* so we stop responding config accesses even if the +* device is not deleted (failover flow) +*/ +return pci_dev && pci_dev->partially_hotplugged && + !pci_dev->qdev.pending_deleted_event; +} +void pci_host_config_write_common (PCIDevice *pci_dev,uint32_t addr,uint32_t limit,uint32_t val,uint32_t len) {
@@ -75,7 +86,7 @@ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr,* allowing direct removal of unexposed functions. */ if ((pci_dev->qdev.hotplugged && !pci_get_function_0 (pci_dev)) || - !pci_dev->has_power) { + !pci_dev->has_power ||is_pci_dev_ejected (pci_dev)) {return ; }
@@ -100,7 +111,7 @@ uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr,* allowing direct removal of unexposed functions. */ if ((pci_dev->qdev.hotplugged && !pci_get_function_0 (pci_dev)) || - !pci_dev->has_power) { + !pci_dev->has_power ||is_pci_dev_ejected (pci_dev)) {return ~0x0 ; }
Signature · 1 line
MST
[PULL 12/22] virtio: Fix packed virtqueue used_idx mask
In reply to Michael S. TsirkinFrom: Hanna Czenczek <[email protected]>
virtio_queue_packed_set_last_avail_idx() is used by vhost devices to set the internal queue indices to what has been reported by the vhost back-end through GET_VRING_BASE. For packed virtqueues, this 32-bit value is expected to contain both the device's internal avail and used indices, as well as their respective wrap counters.
To get the used index, we shift the 32-bit value right by 16, and then apply a mask of 0x7ffff. That seems to be a typo, because it should be 0x7fff; first of all, the virtio specification says that the maximum queue size for packed virt queues is 2^15, so the indices cannot exceed 2^15 - 1 anyway, making 0x7fff the correct mask. Second, the mask clearly is wrong from context, too, given that (A) idx & 0x70000 must be 0 at this point (idx is 32 bit and was shifted to the right by 16 already), (B) idx & 0x8000 is the used_wrap_counter, so should not be part of the used index, and (C) vq->used_idx is a uint16_t, so cannot fit the 0x70000 part of the mask anyway.
This most likely never produced any guest-visible bugs, though, because for a vhost device, qemu will probably not evaluate the used index outside of virtio_queue_packed_get_last_avail_idx(), where we reconstruct the 32-bit value from avail and used indices and their wrap counters again. There, it does not matter whether the highest bit of the used_idx is the used index wrap counter, because we put the wrap counter exactly in that position anyway.
Message-Id: <[email protected]>
--- hw/virtio/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio.c +1 -1
@@ -3321,7 +3321,7 @@ static void virtio_queue_packed_set_last_avail_idx(VirtIODevice *vdev, vq->last_avail_wrap_counter = vq->shadow_avail_wrap_counter = !!(idx &0x8000 ); idx >>=16 ; - vq->used_idx = idx &0x7ffff ; + vq->used_idx = idx &0x7fff ; vq->used_wrap_counter = !!(idx &0x8000 ); }
Signature · 1 line
MST
[PULL 10/22] tests: acpi: update expected blobs
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
Expected change is that _ADR object is removed from hostbridge descriptor in DSDT for PC and Q35 machines.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 37 ------------------ tests/data/acpi/pc/DSDT | Bin 6836 -> 6830 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 6747 -> 6741 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 8161 -> 8155 bytes tests/data/acpi/pc/DSDT.bridge | Bin 13707 -> 13701 bytes tests/data/acpi/pc/DSDT.cphp | Bin 7300 -> 7294 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 8490 -> 8484 bytes tests/data/acpi/pc/DSDT.hpbridge | Bin 6787 -> 6781 bytes tests/data/acpi/pc/DSDT.hpbrroot | Bin 3343 -> 3337 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 6908 -> 6902 bytes tests/data/acpi/pc/DSDT.memhp | Bin 8195 -> 8189 bytes tests/data/acpi/pc/DSDT.nohpet | Bin 6694 -> 6688 bytes tests/data/acpi/pc/DSDT.numamem | Bin 6842 -> 6836 bytes tests/data/acpi/pc/DSDT.roothp | Bin 10629 -> 10623 bytes tests/data/acpi/q35/DSDT | Bin 8361 -> 8355 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 8378 -> 8372 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9686 -> 9680 bytes tests/data/acpi/q35/DSDT.acpihmat-noinitiator | Bin 8640 -> 8634 bytes tests/data/acpi/q35/DSDT.applesmc | Bin 8407 -> 8401 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11974 -> 11968 bytes tests/data/acpi/q35/DSDT.core-count2 | Bin 32501 -> 32495 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8825 -> 8819 bytes tests/data/acpi/q35/DSDT.cxl | Bin 9673 -> 9655 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 10015 -> 10009 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 8436 -> 8430 bytes tests/data/acpi/q35/DSDT.ipmismbus | Bin 8449 -> 8443 bytes tests/data/acpi/q35/DSDT.ivrs | Bin 8378 -> 8372 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9720 -> 9714 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 9491 -> 9485 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 13214 -> 13208 bytes tests/data/acpi/q35/DSDT.noacpihp | Bin 8241 -> 8235 bytes tests/data/acpi/q35/DSDT.nohpet | Bin 8219 -> 8213 bytes tests/data/acpi/q35/DSDT.numamem | Bin 8367 -> 8361 bytes tests/data/acpi/q35/DSDT.pvpanic-isa | Bin 8462 -> 8456 bytes tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8967 -> 8961 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 8993 -> 8987 bytes tests/data/acpi/q35/DSDT.viot | Bin 9470 -> 9464 bytes tests/data/acpi/q35/DSDT.xapic | Bin 35724 -> 35718 bytes 38 files changed, 37 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -37
@@ -1,38 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/pc/DSDT" , -"tests/data/acpi/pc/DSDT.acpierst" , -"tests/data/acpi/pc/DSDT.acpihmat" , -"tests/data/acpi/pc/DSDT.bridge" , -"tests/data/acpi/pc/DSDT.cphp" , -"tests/data/acpi/pc/DSDT.dimmpxm" , -"tests/data/acpi/pc/DSDT.hpbridge" , -"tests/data/acpi/pc/DSDT.hpbrroot" , -"tests/data/acpi/pc/DSDT.ipmikcs" , -"tests/data/acpi/pc/DSDT.memhp" , -"tests/data/acpi/pc/DSDT.nohpet" , -"tests/data/acpi/pc/DSDT.numamem" , -"tests/data/acpi/pc/DSDT.roothp" , -"tests/data/acpi/q35/DSDT" , -"tests/data/acpi/q35/DSDT.acpierst" , -"tests/data/acpi/q35/DSDT.acpihmat" , -"tests/data/acpi/q35/DSDT.acpihmat-noinitiator" , -"tests/data/acpi/q35/DSDT.applesmc" , -"tests/data/acpi/q35/DSDT.bridge" , -"tests/data/acpi/q35/DSDT.core-count2" , -"tests/data/acpi/q35/DSDT.cphp" , -"tests/data/acpi/q35/DSDT.cxl" , -"tests/data/acpi/q35/DSDT.dimmpxm" , -"tests/data/acpi/q35/DSDT.ipmibt" , -"tests/data/acpi/q35/DSDT.ipmismbus" , -"tests/data/acpi/q35/DSDT.ivrs" , -"tests/data/acpi/q35/DSDT.memhp" , -"tests/data/acpi/q35/DSDT.mmio64" , -"tests/data/acpi/q35/DSDT.multi-bridge" , -"tests/data/acpi/q35/DSDT.noacpihp" , -"tests/data/acpi/q35/DSDT.nohpet" , -"tests/data/acpi/q35/DSDT.numamem" , -"tests/data/acpi/q35/DSDT.pvpanic-isa" , -"tests/data/acpi/q35/DSDT.tis.tpm12" , -"tests/data/acpi/q35/DSDT.tis.tpm2" , -"tests/data/acpi/q35/DSDT.viot" , -"tests/data/acpi/q35/DSDT.xapic",
tests/data/acpi/pc/DSDT binary +0 -0
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
tests/data/acpi/pc/DSDT.bridge binary +0 -0
tests/data/acpi/pc/DSDT.cphp binary +0 -0
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
tests/data/acpi/pc/DSDT.hpbrroot binary +0 -0
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
tests/data/acpi/pc/DSDT.memhp binary +0 -0
tests/data/acpi/pc/DSDT.nohpet binary +0 -0
tests/data/acpi/pc/DSDT.numamem binary +0 -0
tests/data/acpi/pc/DSDT.roothp binary +0 -0
tests/data/acpi/q35/DSDT binary +0 -0
tests/data/acpi/q35/DSDT.acpierst binary +0 -0
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
tests/data/acpi/q35/DSDT.acpihmat-noinitiator binary +0 -0
tests/data/acpi/q35/DSDT.applesmc binary +0 -0
tests/data/acpi/q35/DSDT.bridge binary +0 -0
tests/data/acpi/q35/DSDT.core-count2 binary +0 -0
tests/data/acpi/q35/DSDT.cphp binary +0 -0
tests/data/acpi/q35/DSDT.cxl binary +0 -0
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
tests/data/acpi/q35/DSDT.ipmismbus binary +0 -0
tests/data/acpi/q35/DSDT.ivrs binary +0 -0
tests/data/acpi/q35/DSDT.memhp binary +0 -0
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
tests/data/acpi/q35/DSDT.noacpihp binary +0 -0
tests/data/acpi/q35/DSDT.nohpet binary +0 -0
tests/data/acpi/q35/DSDT.numamem binary +0 -0
tests/data/acpi/q35/DSDT.pvpanic-isa binary +0 -0
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
tests/data/acpi/q35/DSDT.viot binary +0 -0
tests/data/acpi/q35/DSDT.xapic binary +0 -0
Signature · 1 line
MST
[PULL 07/22] tests: acpi: x86: update expected blobs
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
Following change is expected on each PCI slot with enabled ACPI PCI hotplug
- BSEL,
- ASUN
+ Zero,
+ Zero
}+ Local0 [Zero] = BSEL /* \_SB_.PCI0.BSEL */
+ Local0 [One] = ASUN /* \_SB_.PCI0.S18_.ASUN */
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 14 -------------- tests/data/acpi/pc/DSDT | Bin 6488 -> 6836 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 6411 -> 6747 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 7813 -> 8161 bytes tests/data/acpi/pc/DSDT.bridge | Bin 12615 -> 13707 bytes tests/data/acpi/pc/DSDT.cphp | Bin 6952 -> 7300 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 8142 -> 8490 bytes tests/data/acpi/pc/DSDT.hpbridge | Bin 6451 -> 6787 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 6560 -> 6908 bytes tests/data/acpi/pc/DSDT.memhp | Bin 7847 -> 8195 bytes tests/data/acpi/pc/DSDT.nohpet | Bin 6346 -> 6694 bytes tests/data/acpi/pc/DSDT.numamem | Bin 6494 -> 6842 bytes tests/data/acpi/pc/DSDT.roothp | Bin 9873 -> 10629 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11590 -> 11974 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 12770 -> 13214 bytes 15 files changed, 14 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -14
@@ -1,15 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/pc/DSDT" , -"tests/data/acpi/pc/DSDT.acpierst" , -"tests/data/acpi/pc/DSDT.acpihmat" , -"tests/data/acpi/pc/DSDT.bridge" , -"tests/data/acpi/pc/DSDT.cphp" , -"tests/data/acpi/pc/DSDT.dimmpxm" , -"tests/data/acpi/pc/DSDT.hpbridge" , -"tests/data/acpi/pc/DSDT.ipmikcs" , -"tests/data/acpi/pc/DSDT.memhp" , -"tests/data/acpi/pc/DSDT.nohpet" , -"tests/data/acpi/pc/DSDT.numamem" , -"tests/data/acpi/pc/DSDT.roothp" , -"tests/data/acpi/q35/DSDT.bridge" , -"tests/data/acpi/q35/DSDT.multi-bridge",
tests/data/acpi/pc/DSDT binary +0 -0
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
tests/data/acpi/pc/DSDT.bridge binary +0 -0
tests/data/acpi/pc/DSDT.cphp binary +0 -0
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
tests/data/acpi/pc/DSDT.memhp binary +0 -0
tests/data/acpi/pc/DSDT.nohpet binary +0 -0
tests/data/acpi/pc/DSDT.numamem binary +0 -0
tests/data/acpi/pc/DSDT.roothp binary +0 -0
tests/data/acpi/q35/DSDT.bridge binary +0 -0
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
Signature · 1 line
MST
[PULL 21/22] virtio-crypto: verify src&dst buffer length for sym request
In reply to Michael S. TsirkinFrom: zhenwei pi <[email protected]>
For symmetric algorithms, the length of ciphertext must be as same as the plaintext.
The missing verification of the src_len and the dst_len in virtio_crypto_sym_op_helper() may lead buffer overflow/divulged.
This patch is originally written by Yiming Tao for QEMU-SECURITY, resend it(a few changes of error message) in qemu-devel.
Message-Id: <[email protected]>
--- hw/virtio/virtio-crypto.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/virtio/virtio-crypto.c +5 -0
@@ -634,6 +634,11 @@ virtio_crypto_sym_op_helper(VirtIODevice *vdev,return NULL ; } +if (unlikely (src_len != dst_len)) { +virtio_error (vdev,"sym request src len is different from dst len" ); +return NULL ; + } + max_len = (uint64_t )iv_len + aad_len + src_len + dst_len + hash_result_len;if (unlikely (max_len > vcrypto->conf.max_size)) {virtio_error (vdev,"virtio-crypto too big length" );
Signature · 1 line
MST
Richard Henderson
AppliedQuoted 10 lines · Michael S. Tsirkin
The following changes since commit
c167c80b463768e04a22fbe37ba6c53a4a08e41e:Merge tag 'pull-request-2023-08-03' ofhttps://gitlab.com/thuth/qemu into staging (2023-08-03 07:37:17 -0700)are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
15b11a1da6a4b7c6b8bb37883f52b544dee2b8fd:
Quoted 8 lines
cryptodev: Handle unexpected request to avoid crash (2023-08-03 16:16:17 -0400)
----------------------------------------------------------------
pc,pci,virtio,crypto: bugfixesfixes all over the place.
Signed-off-by Michael S. Tsirkin<[email protected]>
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.
r~
Re: [PULL 22/22] cryptodev: Handle unexpected request to avoid crash
In reply to Michael S. TsirkinQuoted 15 lines · Michael S. Tsirkin
From: zhenwei pi <[email protected]>
Generally guest side should discover which services the device is able to offer, then do requests on device.
However it's also possible to break this rule in a guest. Handle unexpected request here to avoid NULL pointer dereference.
Fixes e7a775fd ('cryptodev: Account statistics')Cc Gonglei <[email protected]>Cc Mauro Matteo Cascella <[email protected]>Cc Xiao Lei <[email protected]>Cc Yongkang Jia <[email protected]>Reported-by Yiming Tao <[email protected]>Signed-off-by zhenwei pi <[email protected]>
Quoted 3 lines
Message-Id: <[email protected]>
Reviewed-by Michael S. Tsirkin <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
This smells like a stable-8.0 material. Please let me know if it is not.
Thanks,
/mjt
Re: [PULL 14/22] vhost: fix the fd leak
In reply to Michael S. TsirkinQuoted 5 lines · Michael S. Tsirkin
From: Li Feng <[email protected]>
When the vhost-user reconnect to the backend, the notifer should be cleanup. Otherwise, the fd resource will be exhausted.
Quoted 8 lines
Fixes f9a09ca3ea ("vhost: add support for configure interrupt")Signed-off-by Li Feng <[email protected]>Reviewed-by Raphael Norwitz <[email protected]>Message-Id: <[email protected]>
Reviewed-by Michael S. Tsirkin <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>Tested-by Fiona Ebner <[email protected]>
This smells like a stable-8.0 material. Please let me know if it is not.
/mjt
Re: [PULL 13/22] pci: do not respond config requests after PCI device eject
In reply to Michael S. TsirkinQuoted 10 lines · Michael S. Tsirkin
From: Yuri Benditovich <[email protected]>
In migration with VF failover, Windows guest and ACPI hot unplug we do not need to satisfy config requests, otherwise the guest immediately detects the device and brings up its driver. Many network VF's are stuck on the guest PCI bus after the migration.
Quoted 4 lines
Signed-off-by Yuri Benditovich <[email protected]>Message-Id: <[email protected]>
Reviewed-by Michael S. Tsirkin <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
Is it a stable-8.0 (and stable-7.2) material?
Thanks,
/mjt
Re: [PULL 14/22] vhost: fix the fd leak
In reply to Michael TokarevQuoted 1 line · Michael Tokarev
This smells like a stable-8.0 material. Please let me know if it is not.
Ah, it is, Cc'd -stable already. N/m, picked this one up.
/mjt
Re: Re: [PULL 22/22] cryptodev: Handle unexpected request to avoid crash
In reply to Michael TokarevQuoted 20 lines · Michael Tokarev
Quoted 15 lines · Michael S. Tsirkin
From: zhenwei pi <[email protected]>
Generally guest side should discover which services the device is able to offer, then do requests on device.
However it's also possible to break this rule in a guest. Handle unexpected request here to avoid NULL pointer dereference.
Fixes e7a775fd ('cryptodev: Account statistics')Cc Gonglei <[email protected]>Cc Mauro Matteo Cascella <[email protected]>Cc Xiao Lei <[email protected]>Cc Yongkang Jia <[email protected]>Reported-by Yiming Tao <[email protected]>Signed-off-by zhenwei pi <[email protected]>Quoted 3 lines
Message-Id: <[email protected]>
Reviewed-by Michael S. Tsirkin <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
Quoted 5 lines
This smells like a stable-8.0 material. Please let me know if it is not.
Thanks,
/mjt
Hi,
Both this one [1] and the previous one [2] should be table-8.0 material, I think.
[1][PULL 22/22] cryptodev: Handle unexpected request to avoid crash [2][PULL 21/22] virtio-crypto: verify src&dst buffer length for sym request
Signature · 1 line
zhenwei pi
Re: [PULL 22/22] cryptodev: Handle unexpected request to avoid crash
04.08.2023 09:10, zhenwei pi wrote:
..
Quoted 6 lines
Quoted 1 line
This smells like a stable-8.0 material. Please let me know if it is not.
Both this one [1] and the previous one [2] should be table-8.0 material, I think.
[1][PULL 22/22] cryptodev: Handle unexpected request to avoid crash [2][PULL 21/22] virtio-crypto: verify src&dst buffer length for sym request
I picked up the 21 one (virtio-crypto) already without questions (for both 8.0 and 7.2) since it fixes a CVE, but I wasn't 100% sure for the 22 one (cryptodev).
Thank you for letting me know.
/mjt