* [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
@ 2020-08-11 11:41 P J P
2020-08-11 11:41 ` [PATCH v4 1/9] hw/pci-host: add pci-intack write method P J P
` (11 more replies)
0 siblings, 12 replies; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Hello,
* This series asserts that MemoryRegionOps objects define read/write
callback methods. Thus avoids potential NULL pointer dereference.
ex. -> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
* Also adds various undefined MemoryRegionOps read/write functions
to avoid potential assert failure.
Thank you.
--
Prasad J Pandit (9):
hw/pci-host: add pci-intack write method
pci-host: designware: add pcie-msi read method
vfio: add quirk device write method
prep: add ppc-parity write method
nvram: add nrf51_soc flash read method
spapr_pci: add spapr msi read method
tz-ppc: add dummy read/write methods
imx7-ccm: add digprog mmio write method
memory: assert MemoryRegionOps callbacks are defined
hw/misc/imx7_ccm.c | 8 ++++++++
hw/misc/tz-ppc.c | 14 ++++++++++++++
hw/nvram/nrf51_nvm.c | 10 ++++++++++
hw/pci-host/designware.c | 19 +++++++++++++++++++
hw/pci-host/prep.c | 8 ++++++++
hw/ppc/prep_systemio.c | 8 ++++++++
hw/ppc/spapr_pci.c | 14 ++++++++++++--
hw/vfio/pci-quirks.c | 8 ++++++++
softmmu/memory.c | 10 +++++++++-
9 files changed, 96 insertions(+), 3 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v4 1/9] hw/pci-host: add pci-intack write method
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
@ 2020-08-11 11:41 ` P J P
2020-08-11 11:41 ` [PATCH v4 2/9] pci-host: designware: add pcie-msi read method P J P
` (10 subsequent siblings)
11 siblings, 0 replies; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Add pci-intack mmio write method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/pci-host/prep.c | 8 ++++++++
1 file changed, 8 insertions(+)
Update v4: add Reviewed-by tag
-> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05325.html
diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
index 4b93fd2b01..64b33af6c0 100644
--- a/hw/pci-host/prep.c
+++ b/hw/pci-host/prep.c
@@ -26,6 +26,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/units.h"
+#include "qemu/log.h"
#include "qapi/error.h"
#include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"
@@ -119,8 +120,15 @@ static uint64_t raven_intack_read(void *opaque, hwaddr addr,
return pic_read_irq(isa_pic);
}
+static void raven_intack_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__);
+}
+
static const MemoryRegionOps raven_intack_ops = {
.read = raven_intack_read,
+ .write = raven_intack_write,
.valid = {
.max_access_size = 1,
},
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v4 2/9] pci-host: designware: add pcie-msi read method
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
2020-08-11 11:41 ` [PATCH v4 1/9] hw/pci-host: add pci-intack write method P J P
@ 2020-08-11 11:41 ` P J P
2020-08-11 11:41 ` [PATCH v4 3/9] vfio: add quirk device write method P J P
` (9 subsequent siblings)
11 siblings, 0 replies; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Add pcie-msi mmio read method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/pci-host/designware.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
Update v4: add explanatory comment and Reviewed-by tag
-> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05315.html
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index 8492c18991..db036aac71 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/module.h"
+#include "qemu/log.h"
#include "hw/pci/msi.h"
#include "hw/pci/pci_bridge.h"
#include "hw/pci/pci_host.h"
@@ -63,6 +64,23 @@ designware_pcie_root_to_host(DesignwarePCIERoot *root)
return DESIGNWARE_PCIE_HOST(bus->parent);
}
+static uint64_t designware_pcie_root_msi_read(void *opaque, hwaddr addr,
+ unsigned size)
+{
+ /*
+ * Attempts to read from the MSI address are undefined in
+ * the PCI specifications. For this hardware, the datasheet
+ * specifies that a read from the magic address is simply not
+ * intercepted by the MSI controller, and will go out to the
+ * AHB/AXI bus like any other PCI-device-initiated DMA read.
+ * This is not trivial to implement in QEMU, so since
+ * well-behaved guests won't ever ask a PCI device to DMA from
+ * this address we just log the missing functionality.
+ */
+ qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__);
+ return 0;
+}
+
static void designware_pcie_root_msi_write(void *opaque, hwaddr addr,
uint64_t val, unsigned len)
{
@@ -77,6 +95,7 @@ static void designware_pcie_root_msi_write(void *opaque, hwaddr addr,
}
static const MemoryRegionOps designware_pci_host_msi_ops = {
+ .read = designware_pcie_root_msi_read,
.write = designware_pcie_root_msi_write,
.endianness = DEVICE_LITTLE_ENDIAN,
.valid = {
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v4 3/9] vfio: add quirk device write method
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
2020-08-11 11:41 ` [PATCH v4 1/9] hw/pci-host: add pci-intack write method P J P
2020-08-11 11:41 ` [PATCH v4 2/9] pci-host: designware: add pcie-msi read method P J P
@ 2020-08-11 11:41 ` P J P
2020-08-11 11:41 ` [PATCH v4 4/9] prep: add ppc-parity " P J P
` (8 subsequent siblings)
11 siblings, 0 replies; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Add vfio quirk device mmio write method to avoid NULL pointer
dereference issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/vfio/pci-quirks.c | 8 ++++++++
1 file changed, 8 insertions(+)
Update v4: log guest_error and add Reviewed-by tag
-> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05326.html
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index 3a14b7c303..9b162cc3f9 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -14,6 +14,7 @@
#include "config-devices.h"
#include "exec/memop.h"
#include "qemu/units.h"
+#include "qemu/log.h"
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
@@ -264,8 +265,15 @@ static uint64_t vfio_ati_3c3_quirk_read(void *opaque,
return data;
}
+static void vfio_ati_3c3_quirk_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid access\n", __func__);
+}
+
static const MemoryRegionOps vfio_ati_3c3_quirk = {
.read = vfio_ati_3c3_quirk_read,
+ .write = vfio_ati_3c3_quirk_write,
.endianness = DEVICE_LITTLE_ENDIAN,
};
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v4 4/9] prep: add ppc-parity write method
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (2 preceding siblings ...)
2020-08-11 11:41 ` [PATCH v4 3/9] vfio: add quirk device write method P J P
@ 2020-08-11 11:41 ` P J P
2020-08-11 15:48 ` Li Qiang
2020-08-11 11:41 ` [PATCH v4 5/9] nvram: add nrf51_soc flash read method P J P
` (7 subsequent siblings)
11 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Add ppc-parity mmio write method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/ppc/prep_systemio.c | 8 ++++++++
1 file changed, 8 insertions(+)
Update v4: No change, v3 was acked
-> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09965.html
diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c
index bbc51b6e9a..e583222a1b 100644
--- a/hw/ppc/prep_systemio.c
+++ b/hw/ppc/prep_systemio.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/log.h"
#include "hw/irq.h"
#include "hw/isa/isa.h"
#include "hw/qdev-properties.h"
@@ -235,8 +236,15 @@ static uint64_t ppc_parity_error_readl(void *opaque, hwaddr addr,
return val;
}
+static void ppc_parity_error_writel(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid access\n", __func__);
+}
+
static const MemoryRegionOps ppc_parity_error_ops = {
.read = ppc_parity_error_readl,
+ .write = ppc_parity_error_writel,
.valid = {
.min_access_size = 4,
.max_access_size = 4,
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v4 5/9] nvram: add nrf51_soc flash read method
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (3 preceding siblings ...)
2020-08-11 11:41 ` [PATCH v4 4/9] prep: add ppc-parity " P J P
@ 2020-08-11 11:41 ` P J P
2020-08-11 15:42 ` Li Qiang
2020-08-11 11:41 ` [PATCH v4 6/9] spapr_pci: add spapr msi " P J P
` (6 subsequent siblings)
11 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Add nrf51_soc mmio read method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/nvram/nrf51_nvm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Update v4: add explanatory comment and Reviewed-by tag
-> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05309.html
diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c
index f2283c1a8d..7b3460d52d 100644
--- a/hw/nvram/nrf51_nvm.c
+++ b/hw/nvram/nrf51_nvm.c
@@ -273,6 +273,15 @@ static const MemoryRegionOps io_ops = {
.endianness = DEVICE_LITTLE_ENDIAN,
};
+static uint64_t flash_read(void *opaque, hwaddr offset, unsigned size)
+{
+ /*
+ * This is a rom_device MemoryRegion which is always in
+ * romd_mode (we never put it in MMIO mode), so reads always
+ * go directly to RAM and never come here.
+ */
+ g_assert_not_reached();
+}
static void flash_write(void *opaque, hwaddr offset, uint64_t value,
unsigned int size)
@@ -300,6 +309,7 @@ static void flash_write(void *opaque, hwaddr offset, uint64_t value,
static const MemoryRegionOps flash_ops = {
+ .read = flash_read,
.write = flash_write,
.valid.min_access_size = 4,
.valid.max_access_size = 4,
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v4 6/9] spapr_pci: add spapr msi read method
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (4 preceding siblings ...)
2020-08-11 11:41 ` [PATCH v4 5/9] nvram: add nrf51_soc flash read method P J P
@ 2020-08-11 11:41 ` P J P
2020-08-11 14:07 ` Philippe Mathieu-Daudé
2020-08-11 11:41 ` [PATCH v4 7/9] tz-ppc: add dummy read/write methods P J P
` (5 subsequent siblings)
11 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Add spapr msi mmio read method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/ppc/spapr_pci.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
Update v4: fix multi-line comment and log guest_error
-> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05311.html
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 363cdb3f7b..53dfd3d8c6 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -52,6 +52,7 @@
#include "sysemu/kvm.h"
#include "sysemu/hostmem.h"
#include "sysemu/numa.h"
+#include "qemu/log.h"
/* Copied from the kernel arch/powerpc/platforms/pseries/msi.c */
#define RTAS_QUERY_FN 0
@@ -738,6 +739,12 @@ static PCIINTxRoute spapr_route_intx_pin_to_irq(void *opaque, int pin)
return route;
}
+static uint64_t spapr_msi_read(void *opaque, hwaddr addr, unsigned size)
+{
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid access\n", __func__);
+ return 0;
+}
+
/*
* MSI/MSIX memory region implementation.
* The handler handles both MSI and MSIX.
@@ -755,8 +762,11 @@ static void spapr_msi_write(void *opaque, hwaddr addr,
}
static const MemoryRegionOps spapr_msi_ops = {
- /* There is no .read as the read result is undefined by PCI spec */
- .read = NULL,
+ /*
+ * .read result is undefined by PCI spec.
+ * define .read method to avoid assert failure in memory_region_init_io
+ */
+ .read = spapr_msi_read,
.write = spapr_msi_write,
.endianness = DEVICE_LITTLE_ENDIAN
};
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v4 7/9] tz-ppc: add dummy read/write methods
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (5 preceding siblings ...)
2020-08-11 11:41 ` [PATCH v4 6/9] spapr_pci: add spapr msi " P J P
@ 2020-08-11 11:41 ` P J P
2020-08-11 15:39 ` Li Qiang
2020-08-11 11:41 ` [PATCH v4 8/9] imx7-ccm: add digprog mmio write method P J P
` (4 subsequent siblings)
11 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Add tz-ppc-dummy mmio read/write methods to avoid assert failure
during initialisation.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/misc/tz-ppc.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Update v4: add Reviewed-by tag
-> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05303.html
diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c
index 6431257b52..36495c68e7 100644
--- a/hw/misc/tz-ppc.c
+++ b/hw/misc/tz-ppc.c
@@ -196,7 +196,21 @@ static bool tz_ppc_dummy_accepts(void *opaque, hwaddr addr,
g_assert_not_reached();
}
+static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size)
+{
+ g_assert_not_reached();
+}
+
+static void tz_ppc_dummy_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ g_assert_not_reached();
+}
+
static const MemoryRegionOps tz_ppc_dummy_ops = {
+ /* define r/w methods to avoid assert failure in memory_region_init_io */
+ .read = tz_ppc_dummy_read,
+ .write = tz_ppc_dummy_write,
.valid.accepts = tz_ppc_dummy_accepts,
};
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v4 8/9] imx7-ccm: add digprog mmio write method
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (6 preceding siblings ...)
2020-08-11 11:41 ` [PATCH v4 7/9] tz-ppc: add dummy read/write methods P J P
@ 2020-08-11 11:41 ` P J P
2020-08-11 11:41 ` [PATCH v4 9/9] memory: assert MemoryRegionOps callbacks are defined P J P
` (3 subsequent siblings)
11 siblings, 0 replies; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
Add digprog mmio write method to avoid assert failure during
initialisation.
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/misc/imx7_ccm.c | 8 ++++++++
1 file changed, 8 insertions(+)
Update v4: revise log message to guest_error
-> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05306.html
diff --git a/hw/misc/imx7_ccm.c b/hw/misc/imx7_ccm.c
index 02fc1ae8d0..075159e497 100644
--- a/hw/misc/imx7_ccm.c
+++ b/hw/misc/imx7_ccm.c
@@ -131,8 +131,16 @@ static const struct MemoryRegionOps imx7_set_clr_tog_ops = {
},
};
+static void imx7_digprog_write(void *opaque, hwaddr addr,
+ uint64_t data, unsigned size)
+{
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "Guest write to read-only ANALOG_DIGPROG register\n");
+}
+
static const struct MemoryRegionOps imx7_digprog_ops = {
.read = imx7_set_clr_tog_read,
+ .write = imx7_digprog_write,
.endianness = DEVICE_NATIVE_ENDIAN,
.impl = {
.min_access_size = 4,
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v4 9/9] memory: assert MemoryRegionOps callbacks are defined
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (7 preceding siblings ...)
2020-08-11 11:41 ` [PATCH v4 8/9] imx7-ccm: add digprog mmio write method P J P
@ 2020-08-11 11:41 ` P J P
2020-09-16 14:17 ` Philippe Mathieu-Daudé
2020-08-13 6:36 ` [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks David Gibson
` (2 subsequent siblings)
11 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-11 11:41 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
From: Prasad J Pandit <pjp@fedoraproject.org>
When registering a MemoryRegionOps object, assert that its
read/write callback methods are defined. This avoids potential
guest crash via a NULL pointer dereference.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
softmmu/memory.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Update v4: add Reviewed-by tag
-> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05324.html
diff --git a/softmmu/memory.c b/softmmu/memory.c
index af25987518..1f4b37b3a6 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1485,7 +1485,13 @@ void memory_region_init_io(MemoryRegion *mr,
uint64_t size)
{
memory_region_init(mr, owner, name, size);
- mr->ops = ops ? ops : &unassigned_mem_ops;
+ if (ops) {
+ assert(ops->read || ops->read_with_attrs);
+ assert(ops->write || ops->write_with_attrs);
+ mr->ops = ops;
+ } else {
+ mr->ops = &unassigned_mem_ops;
+ }
mr->opaque = opaque;
mr->terminates = true;
}
@@ -1663,6 +1669,8 @@ void memory_region_init_rom_device_nomigrate(MemoryRegion *mr,
{
Error *err = NULL;
assert(ops);
+ assert(ops->read || ops->read_with_attrs);
+ assert(ops->write || ops->write_with_attrs);
memory_region_init(mr, owner, name, size);
mr->ops = ops;
mr->opaque = opaque;
--
2.26.2
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH v4 6/9] spapr_pci: add spapr msi read method
2020-08-11 11:41 ` [PATCH v4 6/9] spapr_pci: add spapr msi " P J P
@ 2020-08-11 14:07 ` Philippe Mathieu-Daudé
2020-08-11 17:04 ` P J P
0 siblings, 1 reply; 29+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-11 14:07 UTC (permalink / raw)
To: P J P, Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Michael S. Tsirkin, Li Qiang, QEMU Developers,
Lei Sun, Alex Williamson, Alex Bennée, David Gibson
Cc'ing PCI maintainers
On 8/11/20 1:41 PM, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> Add spapr msi mmio read method to avoid NULL pointer dereference
> issue.
>
> Reported-by: Lei Sun <slei.casper@gmail.com>
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> Reviewed-by: Li Qiang <liq3ea@gmail.com>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
> hw/ppc/spapr_pci.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> Update v4: fix multi-line comment and log guest_error
> -> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05311.html
>
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 363cdb3f7b..53dfd3d8c6 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -52,6 +52,7 @@
> #include "sysemu/kvm.h"
> #include "sysemu/hostmem.h"
> #include "sysemu/numa.h"
> +#include "qemu/log.h"
>
> /* Copied from the kernel arch/powerpc/platforms/pseries/msi.c */
> #define RTAS_QUERY_FN 0
> @@ -738,6 +739,12 @@ static PCIINTxRoute spapr_route_intx_pin_to_irq(void *opaque, int pin)
> return route;
> }
>
> +static uint64_t spapr_msi_read(void *opaque, hwaddr addr, unsigned size)
> +{
> + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid access\n", __func__);
> + return 0;
> +}
> +
> /*
> * MSI/MSIX memory region implementation.
> * The handler handles both MSI and MSIX.
> @@ -755,8 +762,11 @@ static void spapr_msi_write(void *opaque, hwaddr addr,
> }
>
> static const MemoryRegionOps spapr_msi_ops = {
> - /* There is no .read as the read result is undefined by PCI spec */
> - .read = NULL,
> + /*
> + * .read result is undefined by PCI spec.
> + * define .read method to avoid assert failure in memory_region_init_io
> + */
> + .read = spapr_msi_read,
Shouldn't this be a read_with_attrs handler returning MEMTX_ERROR
instead? Maybe we need another MemTxResult which does not yet exist.
> .write = spapr_msi_write,
> .endianness = DEVICE_LITTLE_ENDIAN
> };
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 7/9] tz-ppc: add dummy read/write methods
2020-08-11 11:41 ` [PATCH v4 7/9] tz-ppc: add dummy read/write methods P J P
@ 2020-08-11 15:39 ` Li Qiang
0 siblings, 0 replies; 29+ messages in thread
From: Li Qiang @ 2020-08-11 15:39 UTC (permalink / raw)
To: P J P
Cc: Peter Maydell, Prasad J Pandit, Philippe Mathieu-Daudé,
QEMU Developers, Lei Sun, Alex Williamson, Paolo Bonzini,
Alex Bennée, David Gibson
P J P <ppandit@redhat.com> 于2020年8月11日周二 下午7:44写道:
>
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> Add tz-ppc-dummy mmio read/write methods to avoid assert failure
> during initialisation.
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
> ---
> hw/misc/tz-ppc.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> Update v4: add Reviewed-by tag
> -> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05303.html
>
> diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c
> index 6431257b52..36495c68e7 100644
> --- a/hw/misc/tz-ppc.c
> +++ b/hw/misc/tz-ppc.c
> @@ -196,7 +196,21 @@ static bool tz_ppc_dummy_accepts(void *opaque, hwaddr addr,
> g_assert_not_reached();
> }
>
> +static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size)
> +{
> + g_assert_not_reached();
> +}
> +
> +static void tz_ppc_dummy_write(void *opaque, hwaddr addr,
> + uint64_t data, unsigned size)
> +{
> + g_assert_not_reached();
> +}
> +
> static const MemoryRegionOps tz_ppc_dummy_ops = {
> + /* define r/w methods to avoid assert failure in memory_region_init_io */
> + .read = tz_ppc_dummy_read,
> + .write = tz_ppc_dummy_write,
> .valid.accepts = tz_ppc_dummy_accepts,
> };
>
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 5/9] nvram: add nrf51_soc flash read method
2020-08-11 11:41 ` [PATCH v4 5/9] nvram: add nrf51_soc flash read method P J P
@ 2020-08-11 15:42 ` Li Qiang
0 siblings, 0 replies; 29+ messages in thread
From: Li Qiang @ 2020-08-11 15:42 UTC (permalink / raw)
To: P J P
Cc: Peter Maydell, Prasad J Pandit, Philippe Mathieu-Daudé,
QEMU Developers, Lei Sun, Alex Williamson, Paolo Bonzini,
Alex Bennée, David Gibson
P J P <ppandit@redhat.com> 于2020年8月11日周二 下午7:44写道:
>
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> Add nrf51_soc mmio read method to avoid NULL pointer dereference
> issue.
>
> Reported-by: Lei Sun <slei.casper@gmail.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
> ---
> hw/nvram/nrf51_nvm.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> Update v4: add explanatory comment and Reviewed-by tag
> -> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05309.html
>
> diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c
> index f2283c1a8d..7b3460d52d 100644
> --- a/hw/nvram/nrf51_nvm.c
> +++ b/hw/nvram/nrf51_nvm.c
> @@ -273,6 +273,15 @@ static const MemoryRegionOps io_ops = {
> .endianness = DEVICE_LITTLE_ENDIAN,
> };
>
> +static uint64_t flash_read(void *opaque, hwaddr offset, unsigned size)
> +{
> + /*
> + * This is a rom_device MemoryRegion which is always in
> + * romd_mode (we never put it in MMIO mode), so reads always
> + * go directly to RAM and never come here.
> + */
> + g_assert_not_reached();
> +}
>
> static void flash_write(void *opaque, hwaddr offset, uint64_t value,
> unsigned int size)
> @@ -300,6 +309,7 @@ static void flash_write(void *opaque, hwaddr offset, uint64_t value,
>
>
> static const MemoryRegionOps flash_ops = {
> + .read = flash_read,
> .write = flash_write,
> .valid.min_access_size = 4,
> .valid.max_access_size = 4,
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 4/9] prep: add ppc-parity write method
2020-08-11 11:41 ` [PATCH v4 4/9] prep: add ppc-parity " P J P
@ 2020-08-11 15:48 ` Li Qiang
0 siblings, 0 replies; 29+ messages in thread
From: Li Qiang @ 2020-08-11 15:48 UTC (permalink / raw)
To: P J P
Cc: Peter Maydell, Prasad J Pandit, Philippe Mathieu-Daudé,
QEMU Developers, Lei Sun, Alex Williamson, Paolo Bonzini,
Alex Bennée, David Gibson
P J P <ppandit@redhat.com> 于2020年8月11日周二 下午7:44写道:
>
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> Add ppc-parity mmio write method to avoid NULL pointer dereference
> issue.
>
> Reported-by: Lei Sun <slei.casper@gmail.com>
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
> ---
> hw/ppc/prep_systemio.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> Update v4: No change, v3 was acked
> -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09965.html
>
> diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c
> index bbc51b6e9a..e583222a1b 100644
> --- a/hw/ppc/prep_systemio.c
> +++ b/hw/ppc/prep_systemio.c
> @@ -23,6 +23,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qemu/log.h"
> #include "hw/irq.h"
> #include "hw/isa/isa.h"
> #include "hw/qdev-properties.h"
> @@ -235,8 +236,15 @@ static uint64_t ppc_parity_error_readl(void *opaque, hwaddr addr,
> return val;
> }
>
> +static void ppc_parity_error_writel(void *opaque, hwaddr addr,
> + uint64_t data, unsigned size)
> +{
> + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid access\n", __func__);
> +}
> +
> static const MemoryRegionOps ppc_parity_error_ops = {
> .read = ppc_parity_error_readl,
> + .write = ppc_parity_error_writel,
> .valid = {
> .min_access_size = 4,
> .max_access_size = 4,
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 6/9] spapr_pci: add spapr msi read method
2020-08-11 14:07 ` Philippe Mathieu-Daudé
@ 2020-08-11 17:04 ` P J P
0 siblings, 0 replies; 29+ messages in thread
From: P J P @ 2020-08-11 17:04 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Peter Maydell, Michael S. Tsirkin, Li Qiang, QEMU Developers,
Lei Sun, Alex Williamson, Paolo Bonzini, Alex Bennée,
David Gibson
[-- Attachment #1: Type: text/plain, Size: 494 bytes --]
+-- On Tue, 11 Aug 2020, Philippe Mathieu-Daudé wrote --+
| Cc'ing PCI maintainers
...
| > + .read = spapr_msi_read,
|
| Shouldn't this be a read_with_attrs handler returning MEMTX_ERROR
| instead? Maybe we need another MemTxResult which does not yet exist.
Could this be a subsequent new patch? This patch series is reviewed/ack'd,
could be included in the v5.1.0 release.
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (8 preceding siblings ...)
2020-08-11 11:41 ` [PATCH v4 9/9] memory: assert MemoryRegionOps callbacks are defined P J P
@ 2020-08-13 6:36 ` David Gibson
2020-08-13 13:43 ` P J P
2020-08-16 16:27 ` Philippe Mathieu-Daudé
2020-09-15 13:33 ` P J P
11 siblings, 1 reply; 29+ messages in thread
From: David Gibson @ 2020-08-13 6:36 UTC (permalink / raw)
To: P J P
Cc: Peter Maydell, Prasad J Pandit, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Paolo Bonzini, Alex Bennée
[-- Attachment #1: Type: text/plain, Size: 856 bytes --]
On Tue, Aug 11, 2020 at 05:11:24PM +0530, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> Hello,
>
> * This series asserts that MemoryRegionOps objects define read/write
> callback methods. Thus avoids potential NULL pointer dereference.
> ex. -> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
>
> * Also adds various undefined MemoryRegionOps read/write functions
> to avoid potential assert failure.
The overall idea seems fine. Looks like we could avoid a fair bit of
boilerplate - and slightly reduce our binary size - by introducing a
global unimplemented_write() function.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-13 6:36 ` [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks David Gibson
@ 2020-08-13 13:43 ` P J P
2020-08-13 15:01 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-13 13:43 UTC (permalink / raw)
To: David Gibson
Cc: Peter Maydell, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Paolo Bonzini, Alex Bennée
+-- On Thu, 13 Aug 2020, David Gibson wrote --+
| The overall idea seems fine. Looks like we could avoid a fair bit of
| boilerplate - and slightly reduce our binary size - by introducing a global
| unimplemented_write() function.
* You mean for after this assert(3) in memory_region_init_io change is merged?
This series attempts to define all missing r/w calls.
* There are also unassigned_mem_read/write functions, maybe those can be
reused?
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-13 13:43 ` P J P
@ 2020-08-13 15:01 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 29+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-13 15:01 UTC (permalink / raw)
To: P J P, David Gibson
Cc: Peter Maydell, Li Qiang, QEMU Developers, Lei Sun,
Alex Williamson, Paolo Bonzini, Alex Bennée
On 8/13/20 3:43 PM, P J P wrote:
> +-- On Thu, 13 Aug 2020, David Gibson wrote --+
> | The overall idea seems fine. Looks like we could avoid a fair bit of
> | boilerplate - and slightly reduce our binary size - by introducing a global
> | unimplemented_write() function.
IIRC in v2 or v3 it was mentioned each device has to be handled
differently, as it behaves differently, it sits on a particular bus, and
so on. So the preferred way is to have a device-specific handler.
(This explains v4 and why these patches took so long).
>
> * You mean for after this assert(3) in memory_region_init_io change is merged?
> This series attempts to define all missing r/w calls.
>
> * There are also unassigned_mem_read/write functions, maybe those can be
> reused?
>
>
> Thank you.
> --
> Prasad J Pandit / Red Hat Product Security Team
> 8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (9 preceding siblings ...)
2020-08-13 6:36 ` [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks David Gibson
@ 2020-08-16 16:27 ` Philippe Mathieu-Daudé
2020-08-17 5:02 ` P J P
2020-09-15 13:33 ` P J P
11 siblings, 1 reply; 29+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-16 16:27 UTC (permalink / raw)
To: P J P, Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Li Qiang, QEMU Developers, Lei Sun,
Alex Williamson, Alex Bennée, David Gibson
On 8/11/20 1:41 PM, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> Hello,
>
> * This series asserts that MemoryRegionOps objects define read/write
> callback methods. Thus avoids potential NULL pointer dereference.
> ex. -> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
>
> * Also adds various undefined MemoryRegionOps read/write functions
> to avoid potential assert failure.
What about read_with_attrs()/write_with_attrs()?
It seems they are part of the same problem.
>
> Thank you.
> --
> Prasad J Pandit (9):
> hw/pci-host: add pci-intack write method
> pci-host: designware: add pcie-msi read method
> vfio: add quirk device write method
> prep: add ppc-parity write method
> nvram: add nrf51_soc flash read method
> spapr_pci: add spapr msi read method
> tz-ppc: add dummy read/write methods
> imx7-ccm: add digprog mmio write method
> memory: assert MemoryRegionOps callbacks are defined
>
> hw/misc/imx7_ccm.c | 8 ++++++++
> hw/misc/tz-ppc.c | 14 ++++++++++++++
> hw/nvram/nrf51_nvm.c | 10 ++++++++++
> hw/pci-host/designware.c | 19 +++++++++++++++++++
> hw/pci-host/prep.c | 8 ++++++++
> hw/ppc/prep_systemio.c | 8 ++++++++
> hw/ppc/spapr_pci.c | 14 ++++++++++++--
> hw/vfio/pci-quirks.c | 8 ++++++++
> softmmu/memory.c | 10 +++++++++-
> 9 files changed, 96 insertions(+), 3 deletions(-)
>
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-16 16:27 ` Philippe Mathieu-Daudé
@ 2020-08-17 5:02 ` P J P
2020-08-17 5:26 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-17 5:02 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Peter Maydell, Li Qiang, QEMU Developers, Lei Sun,
Alex Williamson, Paolo Bonzini, Alex Bennée, David Gibson
[-- Attachment #1: Type: text/plain, Size: 1463 bytes --]
+-- On Sun, 16 Aug 2020, Philippe Mathieu-Daudé wrote --+
| On 8/11/20 1:41 PM, P J P wrote:
| > From: Prasad J Pandit <pjp@fedoraproject.org>
| > * This series asserts that MemoryRegionOps objects define read/write
| > callback methods. Thus avoids potential NULL pointer dereference.
| > ex. -> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
| >
| > * Also adds various undefined MemoryRegionOps read/write functions
| > to avoid potential assert failure.
|
| What about read_with_attrs()/write_with_attrs()? It seems they are part of
| the same problem.
* read/write_with_attrs function is called if read/write callback is not
defined
../softmmu/memory.c
if (mr->ops->write) {
... memory_region_write_accessor, mr,
} else {
... memory_region_write_with_attrs_accessor,
So, defining read/write methods may also address read/write_with_attrs
issue?
* $ grep -Eri -A 5 -B 5 '(\.read_with_attrs|\.write_with_attrs)' . | fpaste
-> https://paste.centos.org/view/386c9597
It doesn't show an occurrence where one of the read/write_with_attrs is
missing.
* Nevertheless, if we need to define read/write_with_attrs routines, because
memory_region_init_io() would assert(3) for them
could that be a subsequent patch series please?
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-17 5:02 ` P J P
@ 2020-08-17 5:26 ` Philippe Mathieu-Daudé
2020-08-17 17:38 ` P J P
0 siblings, 1 reply; 29+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-17 5:26 UTC (permalink / raw)
To: P J P
Cc: Peter Maydell, Li Qiang, QEMU Developers, Lei Sun,
Alex Williamson, Paolo Bonzini, Alex Bennée, David Gibson
On 8/17/20 7:02 AM, P J P wrote:
> +-- On Sun, 16 Aug 2020, Philippe Mathieu-Daudé wrote --+
> | On 8/11/20 1:41 PM, P J P wrote:
> | > From: Prasad J Pandit <pjp@fedoraproject.org>
> | > * This series asserts that MemoryRegionOps objects define read/write
> | > callback methods. Thus avoids potential NULL pointer dereference.
> | > ex. -> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
> | >
> | > * Also adds various undefined MemoryRegionOps read/write functions
> | > to avoid potential assert failure.
> |
> | What about read_with_attrs()/write_with_attrs()? It seems they are part of
> | the same problem.
>
> * read/write_with_attrs function is called if read/write callback is not
> defined
>
> ../softmmu/memory.c
> if (mr->ops->write) {
> ... memory_region_write_accessor, mr,
> } else {
> ... memory_region_write_with_attrs_accessor,
>
> So, defining read/write methods may also address read/write_with_attrs
> issue?
>
> * $ grep -Eri -A 5 -B 5 '(\.read_with_attrs|\.write_with_attrs)' . | fpaste
>
> -> https://paste.centos.org/view/386c9597
>
> It doesn't show an occurrence where one of the read/write_with_attrs is
> missing.
>
> * Nevertheless, if we need to define read/write_with_attrs routines, because
> memory_region_init_io() would assert(3) for them
>
> could that be a subsequent patch series please?
Yes no problem, I was just wondering and wasn't sure.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-17 5:26 ` Philippe Mathieu-Daudé
@ 2020-08-17 17:38 ` P J P
2020-08-27 12:08 ` P J P
0 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-17 17:38 UTC (permalink / raw)
To: Peter Maydell
Cc: Li Qiang, Philippe Mathieu-Daudé,
QEMU Developers, Lei Sun, Alex Williamson, Paolo Bonzini,
Alex Bennée, David Gibson
[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]
+-- On Mon, 17 Aug 2020, Philippe Mathieu-Daudé wrote --+
| On 8/17/20 7:02 AM, P J P wrote:
| > +-- On Sun, 16 Aug 2020, Philippe Mathieu-Daudé wrote --+
| > | What about read_with_attrs()/write_with_attrs()? It seems they are part
| > | of the same problem.
| >
| > * read/write_with_attrs function is called if read/write callback is not
| > defined
| >
| > ../softmmu/memory.c
| > if (mr->ops->write) {
| > ... memory_region_write_accessor, mr,
| > } else {
| > ... memory_region_write_with_attrs_accessor,
| >
| > So, defining read/write methods may also address read/write_with_attrs
| > issue?
| >
| > * $ grep -Eri -A 5 -B 5 '(\.read_with_attrs|\.write_with_attrs)' . | fpaste
| >
| > -> https://paste.centos.org/view/386c9597
| >
| > It doesn't show an occurrence where one of the read/write_with_attrs is
| > missing.
| >
| > * Nevertheless, if we need to define read/write_with_attrs routines, because
| > memory_region_init_io() would assert(3) for them
| >
| > could that be a subsequent patch series please?
|
| Yes no problem, I was just wondering and wasn't sure.
@Peter, @Paolo: (To confirm)
Do we ping/reach out to respective maintainers for merging this series?
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-17 17:38 ` P J P
@ 2020-08-27 12:08 ` P J P
2020-09-03 18:36 ` P J P
0 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-08-27 12:08 UTC (permalink / raw)
To: Paolo Bonzini, Peter Maydell
Cc: Li Qiang, Philippe Mathieu-Daudé,
QEMU Developers, Lei Sun, Alex Williamson, Alex Bennée,
David Gibson
[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]
+-- On Mon, 17 Aug 2020, P J P wrote --+
| +-- On Mon, 17 Aug 2020, Philippe Mathieu-Daudé wrote --+
| | On 8/17/20 7:02 AM, P J P wrote:
| | > +-- On Sun, 16 Aug 2020, Philippe Mathieu-Daudé wrote --+
| | > | What about read_with_attrs()/write_with_attrs()? It seems they are part
| | > | of the same problem.
| | >
| | > * read/write_with_attrs function is called if read/write callback is not
| | > defined
| | >
| | > ../softmmu/memory.c
| | > if (mr->ops->write) {
| | > ... memory_region_write_accessor, mr,
| | > } else {
| | > ... memory_region_write_with_attrs_accessor,
| | >
| | > So, defining read/write methods may also address read/write_with_attrs
| | > issue?
| | >
| | > * $ grep -Eri -A 5 -B 5 '(\.read_with_attrs|\.write_with_attrs)' . | fpaste
| | >
| | > -> https://paste.centos.org/view/386c9597
| | >
| | > It doesn't show an occurrence where one of the read/write_with_attrs is
| | > missing.
| | >
| | > * Nevertheless, if we need to define read/write_with_attrs routines, because
| | > memory_region_init_io() would assert(3) for them
| | >
| | > could that be a subsequent patch series please?
| |
| | Yes no problem, I was just wondering and wasn't sure.
|
| @Peter, @Paolo: (To confirm)
| Do we ping/reach out to respective maintainers for merging this series?
Ping...!
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-27 12:08 ` P J P
@ 2020-09-03 18:36 ` P J P
0 siblings, 0 replies; 29+ messages in thread
From: P J P @ 2020-09-03 18:36 UTC (permalink / raw)
To: Peter Maydell
Cc: Li Qiang, Philippe Mathieu-Daudé,
QEMU Developers, Lei Sun, Alex Williamson, Paolo Bonzini,
Alex Bennée, David Gibson
[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]
+-- On Thu, 27 Aug 2020, P J P wrote --+
| +-- On Mon, 17 Aug 2020, P J P wrote --+
| | +-- On Mon, 17 Aug 2020, Philippe Mathieu-Daudé wrote --+
| | | On 8/17/20 7:02 AM, P J P wrote:
| | | > +-- On Sun, 16 Aug 2020, Philippe Mathieu-Daudé wrote --+
| | | > | What about read_with_attrs()/write_with_attrs()? It seems they are part
| | | > | of the same problem.
| | | >
| | | > * read/write_with_attrs function is called if read/write callback is not
| | | > defined
| | | >
| | | > ../softmmu/memory.c
| | | > if (mr->ops->write) {
| | | > ... memory_region_write_accessor, mr,
| | | > } else {
| | | > ... memory_region_write_with_attrs_accessor,
| | | >
| | | > So, defining read/write methods may also address read/write_with_attrs
| | | > issue?
| | | >
| | | > * $ grep -Eri -A 5 -B 5 '(\.read_with_attrs|\.write_with_attrs)' . | fpaste
| | | >
| | | > -> https://paste.centos.org/view/386c9597
| | | >
| | | > It doesn't show an occurrence where one of the read/write_with_attrs is
| | | > missing.
| | | >
| | | > * Nevertheless, if we need to define read/write_with_attrs routines, because
| | | > memory_region_init_io() would assert(3) for them
| | | >
| | | > could that be a subsequent patch series please?
| | |
| | | Yes no problem, I was just wondering and wasn't sure.
| |
| | @Peter, @Paolo: (To confirm)
| | Do we ping/reach out to respective maintainers for merging this series?
|
Ping..!
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
` (10 preceding siblings ...)
2020-08-16 16:27 ` Philippe Mathieu-Daudé
@ 2020-09-15 13:33 ` P J P
2020-11-25 13:50 ` P J P
11 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-09-15 13:33 UTC (permalink / raw)
To: Peter Maydell, David Gibson, Paolo Bonzini, Alex Williamson,
Hervé Poussineau
Cc: Alex Bennée, Li Qiang, Philippe Mathieu-Daudé,
QEMU Developers, Lei Sun
+-- On Tue, 11 Aug 2020, P J P wrote --+
| * This series asserts that MemoryRegionOps objects define read/write
| callback methods. Thus avoids potential NULL pointer dereference.
| ex. -> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
|
| * Also adds various undefined MemoryRegionOps read/write functions
| to avoid potential assert failure.
|
| Thank you.
| --
| Prasad J Pandit (9):
| hw/pci-host: add pci-intack write method
| pci-host: designware: add pcie-msi read method
| vfio: add quirk device write method
| prep: add ppc-parity write method
| nvram: add nrf51_soc flash read method
| spapr_pci: add spapr msi read method
| tz-ppc: add dummy read/write methods
| imx7-ccm: add digprog mmio write method
| memory: assert MemoryRegionOps callbacks are defined
|
| hw/misc/imx7_ccm.c | 8 ++++++++
| hw/misc/tz-ppc.c | 14 ++++++++++++++
| hw/nvram/nrf51_nvm.c | 10 ++++++++++
| hw/pci-host/designware.c | 19 +++++++++++++++++++
| hw/pci-host/prep.c | 8 ++++++++
| hw/ppc/prep_systemio.c | 8 ++++++++
| hw/ppc/spapr_pci.c | 14 ++++++++++++--
| hw/vfio/pci-quirks.c | 8 ++++++++
| softmmu/memory.c | 10 +++++++++-
| 9 files changed, 96 insertions(+), 3 deletions(-)
Ping...@Peter, @David, @Paolo, @Herve, @Alex,
* This patch series is not pulled/merged yet, could you please help with it?
(Pinging respective maintainers, as didn't get reply for last pings, not
sure how to go about it.)
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 9/9] memory: assert MemoryRegionOps callbacks are defined
2020-08-11 11:41 ` [PATCH v4 9/9] memory: assert MemoryRegionOps callbacks are defined P J P
@ 2020-09-16 14:17 ` Philippe Mathieu-Daudé
2020-09-30 6:05 ` P J P
0 siblings, 1 reply; 29+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-16 14:17 UTC (permalink / raw)
To: P J P, Peter Maydell, Paolo Bonzini
Cc: Prasad J Pandit, Li Qiang, QEMU Developers, Lei Sun,
Alex Williamson, Alex Bennée, David Gibson
On 8/11/20 1:41 PM, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> When registering a MemoryRegionOps object, assert that its
> read/write callback methods are defined. This avoids potential
> guest crash via a NULL pointer dereference.
>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Reviewed-by: Li Qiang <liq3ea@gmail.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> softmmu/memory.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> Update v4: add Reviewed-by tag
> -> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05324.html
>
> diff --git a/softmmu/memory.c b/softmmu/memory.c
> index af25987518..1f4b37b3a6 100644
> --- a/softmmu/memory.c
> +++ b/softmmu/memory.c
> @@ -1485,7 +1485,13 @@ void memory_region_init_io(MemoryRegion *mr,
> uint64_t size)
> {
> memory_region_init(mr, owner, name, size);
> - mr->ops = ops ? ops : &unassigned_mem_ops;
> + if (ops) {
> + assert(ops->read || ops->read_with_attrs);
> + assert(ops->write || ops->write_with_attrs);
> + mr->ops = ops;
> + } else {
> + mr->ops = &unassigned_mem_ops;
> + }
> mr->opaque = opaque;
> mr->terminates = true;
> }
> @@ -1663,6 +1669,8 @@ void memory_region_init_rom_device_nomigrate(MemoryRegion *mr,
> {
> Error *err = NULL;
> assert(ops);
> + assert(ops->read || ops->read_with_attrs);
> + assert(ops->write || ops->write_with_attrs);
> memory_region_init(mr, owner, name, size);
> mr->ops = ops;
> mr->opaque = opaque;
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 9/9] memory: assert MemoryRegionOps callbacks are defined
2020-09-16 14:17 ` Philippe Mathieu-Daudé
@ 2020-09-30 6:05 ` P J P
0 siblings, 0 replies; 29+ messages in thread
From: P J P @ 2020-09-30 6:05 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Peter Maydell, Philippe Mathieu-Daudé,
Li Qiang, QEMU Developers, Lei Sun, Alex Williamson,
Alex Bennée, David Gibson
[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]
+-- On Wed, 16 Sep 2020, Philippe Mathieu-Daudé wrote --+
| On 8/11/20 1:41 PM, P J P wrote:
| > When registering a MemoryRegionOps object, assert that its
| > read/write callback methods are defined. This avoids potential
| > guest crash via a NULL pointer dereference.
| >
| > Suggested-by: Peter Maydell <peter.maydell@linaro.org>
| > Reviewed-by: Li Qiang <liq3ea@gmail.com>
| > Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
| > Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
| Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
| > ---
| > softmmu/memory.c | 10 +++++++++-
| > 1 file changed, 9 insertions(+), 1 deletion(-)
| >
| > Update v4: add Reviewed-by tag
| > -> https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg05324.html
| >
| > diff --git a/softmmu/memory.c b/softmmu/memory.c
| > index af25987518..1f4b37b3a6 100644
| > --- a/softmmu/memory.c
| > +++ b/softmmu/memory.c
| > @@ -1485,7 +1485,13 @@ void memory_region_init_io(MemoryRegion *mr,
| > uint64_t size)
| > {
| > memory_region_init(mr, owner, name, size);
| > - mr->ops = ops ? ops : &unassigned_mem_ops;
| > + if (ops) {
| > + assert(ops->read || ops->read_with_attrs);
| > + assert(ops->write || ops->write_with_attrs);
| > + mr->ops = ops;
| > + } else {
| > + mr->ops = &unassigned_mem_ops;
| > + }
| > mr->opaque = opaque;
| > mr->terminates = true;
| > }
| > @@ -1663,6 +1669,8 @@ void memory_region_init_rom_device_nomigrate(MemoryRegion *mr,
| > {
| > Error *err = NULL;
| > assert(ops);
| > + assert(ops->read || ops->read_with_attrs);
| > + assert(ops->write || ops->write_with_attrs);
| > memory_region_init(mr, owner, name, size);
| > mr->ops = ops;
| > mr->opaque = opaque;
| >
@Paolo...ping!
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-09-15 13:33 ` P J P
@ 2020-11-25 13:50 ` P J P
2021-02-02 16:40 ` Paolo Bonzini
0 siblings, 1 reply; 29+ messages in thread
From: P J P @ 2020-11-25 13:50 UTC (permalink / raw)
To: Paolo Bonzini, Peter Maydell
Cc: Alex Bennée, Li Qiang, QEMU Developers, Lei Sun,
Alex Williamson, Hervé Poussineau,
Philippe Mathieu-Daudé,
David Gibson
+-- On Tue, 15 Sep 2020, P J P wrote --+
| +-- On Tue, 11 Aug 2020, P J P wrote --+
| | * This series asserts that MemoryRegionOps objects define read/write
| | callback methods. Thus avoids potential NULL pointer dereference.
| | ex. -> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
| |
| | * Also adds various undefined MemoryRegionOps read/write functions
| | to avoid potential assert failure.
| |
| | Thank you.
| | --
| | Prasad J Pandit (9):
| | hw/pci-host: add pci-intack write method
| | pci-host: designware: add pcie-msi read method
| | vfio: add quirk device write method
| | prep: add ppc-parity write method
| | nvram: add nrf51_soc flash read method
| | spapr_pci: add spapr msi read method
| | tz-ppc: add dummy read/write methods
| | imx7-ccm: add digprog mmio write method
| | memory: assert MemoryRegionOps callbacks are defined
| |
| | hw/misc/imx7_ccm.c | 8 ++++++++
| | hw/misc/tz-ppc.c | 14 ++++++++++++++
| | hw/nvram/nrf51_nvm.c | 10 ++++++++++
| | hw/pci-host/designware.c | 19 +++++++++++++++++++
| | hw/pci-host/prep.c | 8 ++++++++
| | hw/ppc/prep_systemio.c | 8 ++++++++
| | hw/ppc/spapr_pci.c | 14 ++++++++++++--
| | hw/vfio/pci-quirks.c | 8 ++++++++
| | softmmu/memory.c | 10 +++++++++-
| | 9 files changed, 96 insertions(+), 3 deletions(-)
|
| Ping...@Peter, @David, @Paolo, @Herve, @Alex,
|
| * This patch series is not pulled/merged yet, could you please help with it?
Ping..!
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
2020-11-25 13:50 ` P J P
@ 2021-02-02 16:40 ` Paolo Bonzini
0 siblings, 0 replies; 29+ messages in thread
From: Paolo Bonzini @ 2021-02-02 16:40 UTC (permalink / raw)
To: P J P, Peter Maydell
Cc: Alex Bennée, Li Qiang, QEMU Developers, Lei Sun,
Alex Williamson, Hervé Poussineau,
Philippe Mathieu-Daudé,
David Gibson
On 25/11/20 14:50, P J P wrote:
> +-- On Tue, 15 Sep 2020, P J P wrote --+
> | +-- On Tue, 11 Aug 2020, P J P wrote --+
> | | * This series asserts that MemoryRegionOps objects define read/write
> | | callback methods. Thus avoids potential NULL pointer dereference.
> | | ex. -> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
> | |
> | | * Also adds various undefined MemoryRegionOps read/write functions
> | | to avoid potential assert failure.
> | |
> | | Thank you.
> | | --
> | | Prasad J Pandit (9):
> | | hw/pci-host: add pci-intack write method
> | | pci-host: designware: add pcie-msi read method
> | | vfio: add quirk device write method
> | | prep: add ppc-parity write method
> | | nvram: add nrf51_soc flash read method
> | | spapr_pci: add spapr msi read method
> | | tz-ppc: add dummy read/write methods
> | | imx7-ccm: add digprog mmio write method
> | | memory: assert MemoryRegionOps callbacks are defined
> | |
> | | hw/misc/imx7_ccm.c | 8 ++++++++
> | | hw/misc/tz-ppc.c | 14 ++++++++++++++
> | | hw/nvram/nrf51_nvm.c | 10 ++++++++++
> | | hw/pci-host/designware.c | 19 +++++++++++++++++++
> | | hw/pci-host/prep.c | 8 ++++++++
> | | hw/ppc/prep_systemio.c | 8 ++++++++
> | | hw/ppc/spapr_pci.c | 14 ++++++++++++--
> | | hw/vfio/pci-quirks.c | 8 ++++++++
> | | softmmu/memory.c | 10 +++++++++-
> | | 9 files changed, 96 insertions(+), 3 deletions(-)
> |
> | Ping...@Peter, @David, @Paolo, @Herve, @Alex,
> |
> | * This patch series is not pulled/merged yet, could you please help with it?
>
>
> Ping..!
> --
> Prasad J Pandit / Red Hat Product Security Team
> 8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
>
Queued, thanks!
Paolo
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2021-02-02 17:09 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 11:41 [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks P J P
2020-08-11 11:41 ` [PATCH v4 1/9] hw/pci-host: add pci-intack write method P J P
2020-08-11 11:41 ` [PATCH v4 2/9] pci-host: designware: add pcie-msi read method P J P
2020-08-11 11:41 ` [PATCH v4 3/9] vfio: add quirk device write method P J P
2020-08-11 11:41 ` [PATCH v4 4/9] prep: add ppc-parity " P J P
2020-08-11 15:48 ` Li Qiang
2020-08-11 11:41 ` [PATCH v4 5/9] nvram: add nrf51_soc flash read method P J P
2020-08-11 15:42 ` Li Qiang
2020-08-11 11:41 ` [PATCH v4 6/9] spapr_pci: add spapr msi " P J P
2020-08-11 14:07 ` Philippe Mathieu-Daudé
2020-08-11 17:04 ` P J P
2020-08-11 11:41 ` [PATCH v4 7/9] tz-ppc: add dummy read/write methods P J P
2020-08-11 15:39 ` Li Qiang
2020-08-11 11:41 ` [PATCH v4 8/9] imx7-ccm: add digprog mmio write method P J P
2020-08-11 11:41 ` [PATCH v4 9/9] memory: assert MemoryRegionOps callbacks are defined P J P
2020-09-16 14:17 ` Philippe Mathieu-Daudé
2020-09-30 6:05 ` P J P
2020-08-13 6:36 ` [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks David Gibson
2020-08-13 13:43 ` P J P
2020-08-13 15:01 ` Philippe Mathieu-Daudé
2020-08-16 16:27 ` Philippe Mathieu-Daudé
2020-08-17 5:02 ` P J P
2020-08-17 5:26 ` Philippe Mathieu-Daudé
2020-08-17 17:38 ` P J P
2020-08-27 12:08 ` P J P
2020-09-03 18:36 ` P J P
2020-09-15 13:33 ` P J P
2020-11-25 13:50 ` P J P
2021-02-02 16:40 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.