[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 06/18] pci: mark ROMs read-only
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 06/18] pci: mark ROMs read-only |
Date: |
Thu, 26 Jan 2017 18:15:24 +0200 |
Looks like we didn't mark PCI ROMs as RO allowing
mischief such as guests writing there.
Further, e.g. vhost gets confused trying to allocate
enough space to log writes there. Fix it up.
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
---
hw/pci/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 47ca3af..a563555 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2195,7 +2195,7 @@ static void pci_add_option_rom(PCIDevice *pdev, bool
is_default_rom,
snprintf(name, sizeof(name), "%s.rom",
object_get_typename(OBJECT(pdev)));
}
pdev->has_rom = true;
- memory_region_init_ram(&pdev->rom, OBJECT(pdev), name, size, &error_fatal);
+ memory_region_init_rom(&pdev->rom, OBJECT(pdev), name, size, &error_fatal);
vmstate_register_ram(&pdev->rom, &pdev->qdev);
ptr = memory_region_get_ram_ptr(&pdev->rom);
load_image(path, ptr);
--
MST
- [Qemu-devel] [PULL v2 00/18] virtio, vhost, pci: fixes, features, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 02/18] qxl: switch to constants within BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 01/18] compiler: drop ; after BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 03/18] compiler: rework BUG_ON using a struct, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 04/18] compiler: expression version of QEMU_BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 05/18] ARRAY_SIZE: check that argument is an array, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 06/18] pci: mark ROMs read-only,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 07/18] intel_iommu: fix and simplify size calculation in process_device_iotlb_desc(), Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 08/18] hw/pcie: Introduce a base class for PCI Express Root Ports, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 09/18] hw/ioh3420: derive from PCI Express Root Port base class, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 11/18] hw/i386: check if nvdimm is enabled before plugging, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 12/18] msix: Follow CODING_STYLE, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 10/18] hw/pcie: Introduce Generic PCI Express Root Port, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 13/18] hcd-xhci: check & correct param before using it, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 15/18] virtio: make virtio_should_notify static, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 16/18] vhost: skip ROM sections, Michael S. Tsirkin, 2017/01/26
- [Qemu-devel] [PULL v2 17/18] vhost-user: delete chardev on cleanup, Michael S. Tsirkin, 2017/01/26