hw/pci-host/q35: Ignore write of reserved PCIEXBAR LENGTH field
PATCH v2 1/1 hw/pci-host/q35: Ignore write of reserved PCIEXBAR LENGTH field
libFuzzer triggered the following assertion:
cat << EOF | qemu-system-i386 -M pc-q35-5.0 \
-nographic -monitor none -serial none \
-qtest stdio -d guest_errors -trace pci\*
outl 0xcf8 0xf2000060
outl 0xcfc 0x8400056e
EOF
pci_cfg_write mch 00:0 @0x60 <- 0x8400056e
Aborted (core dumped)This is because guest wrote MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD (reserved value) to the PCIE XBAR register.
There is no indication on the datasheet about what occurs when this value is written. Simply ignore it on QEMU (and report an guest error):
pci_cfg_write mch 00:0 @0x60 <- 0x8400056e
Q35: Reserved PCIEXBAR LENGTH
pci_cfg_read mch 00:0 @0x0 -> 0x8086
pci_cfg_read mch 00:0 @0x0 -> 0x29c08086
...
---
v2: Do not remove default case (rth)
--- hw/pci-host/q35.c | 3 +++ 1 file changed, 3 insertions(+)
hw/pci-host/q35.c +3 -0
@@ -29,6 +29,7 @@*/ #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/i386/pc.h" #include "hw/pci-host/q35.h" #include "hw/qdev-properties.h"
@@ -318,6 +319,8 @@ static void mch_update_pciexbar(MCHPCIState *mch) addr_mask |=MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK ;break ;case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD : +qemu_log_mask (LOG_GUEST_ERROR ,"Q35: Reserved PCIEXBAR LENGTH\n" ); +return ;default :abort (); }
Signature · 1 line
2.26.3
ping?
Quoted 58 lines · Philippe Mathieu-Daudé
libFuzzer triggered the following assertion:
cat << EOF | qemu-system-i386 -M pc-q35-5.0 \ -nographic -monitor none -serial none \ -qtest stdio -d guest_errors -trace pci\* outl 0xcf8 0xf2000060 outl 0xcfc 0x8400056e EOF pci_cfg_write mch 00:0 @0x60 <- 0x8400056e Aborted (core dumped)This is because guest wrote
MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD(reserved value) to the PCIE XBAR register.There is no indication on the datasheet about what occurs when this value is written. Simply ignore it on QEMU (and report an guest error):
pci_cfg_writemch 00:0 @0x60 <-0x8400056e
Q35: Reserved PCIEXBAR LENGTH
pci_cfg_readmch 00:0 @0x0 ->0x8086
pci_cfg_readmch 00:0 @0x0 ->0x29c08086
...Reported-by Alexander Bulekov <[email protected]>Fixes df2d8b3ed4 ("q35: Introduce q35 pc based chipset emulator")Reviewed-by Richard Henderson <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
v2: Do not remove default case (rth)--- hw/pci-host/q35.c | 3 +++ 1 file changed, 3 insertions(+)hw/pci-host/q35.c +3
-0@@ -29,6 +29,7 @@*/ #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/i386/pc.h" #include "hw/pci-host/q35.h" #include "hw/qdev-properties.h" @@ -318,6 +319,8 @@ static void mch_update_pciexbar(MCHPCIState *mch) addr_mask |=MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK ;break ;case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD : +qemu_log_mask (LOG_GUEST_ERROR ,"Q35: Reserved PCIEXBAR LENGTH\n" ); +return ;default :abort (); }
ping?
Quoted 62 lines · Philippe Mathieu-Daudé
ping?
Quoted 58 lines · Philippe Mathieu-Daudé
libFuzzer triggered the following assertion:
cat << EOF | qemu-system-i386 -M pc-q35-5.0 \ -nographic -monitor none -serial none \ -qtest stdio -d guest_errors -trace pci\* outl 0xcf8 0xf2000060 outl 0xcfc 0x8400056e EOF pci_cfg_write mch 00:0 @0x60 <- 0x8400056e Aborted (core dumped)This is because guest wrote
MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD(reserved value) to the PCIE XBAR register.There is no indication on the datasheet about what occurs when this value is written. Simply ignore it on QEMU (and report an guest error):
pci_cfg_writemch 00:0 @0x60 <-0x8400056e
Q35: Reserved PCIEXBAR LENGTH
pci_cfg_readmch 00:0 @0x0 ->0x8086
pci_cfg_readmch 00:0 @0x0 ->0x29c08086
...Reported-by Alexander Bulekov <[email protected]>Fixes df2d8b3ed4 ("q35: Introduce q35 pc based chipset emulator")Reviewed-by Richard Henderson <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
v2: Do not remove default case (rth)--- hw/pci-host/q35.c | 3 +++ 1 file changed, 3 insertions(+)hw/pci-host/q35.c +3
-0@@ -29,6 +29,7 @@*/ #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/i386/pc.h" #include "hw/pci-host/q35.h" #include "hw/qdev-properties.h" @@ -318,6 +319,8 @@ static void mch_update_pciexbar(MCHPCIState *mch) addr_mask |=MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK ;break ;case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD : +qemu_log_mask (LOG_GUEST_ERROR ,"Q35: Reserved PCIEXBAR LENGTH\n" ); +return ;default :abort (); }
Quoted 24 lines · Philippe Mathieu-Daudé
libFuzzer triggered the following assertion:
cat << EOF | qemu-system-i386 -M pc-q35-5.0 \ -nographic -monitor none -serial none \ -qtest stdio -d guest_errors -trace pci\* outl 0xcf8 0xf2000060 outl 0xcfc 0x8400056e EOF pci_cfg_write mch 00:0 @0x60 <- 0x8400056e Aborted (core dumped)This is because guest wrote
MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD(reserved value) to the PCIE XBAR register.There is no indication on the datasheet about what occurs when this value is written. Simply ignore it on QEMU (and report an guest error):
pci_cfg_writemch 00:0 @0x60 <-0x8400056e
Q35: Reserved PCIEXBAR LENGTH
pci_cfg_readmch 00:0 @0x0 ->0x8086
pci_cfg_readmch 00:0 @0x0 ->0x29c08086
...
Quoted 7 lines
Reported-by Alexander Bulekov <[email protected]>Fixes df2d8b3ed4 ("q35: Introduce q35 pc based chipset emulator")Reviewed-by Richard Henderson <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---