mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
pci: Common overflow prevention
Introduce pci_config_read/write_common helpers to prevent passing accesses down the callback chain that go beyond the config space limits. Adjust length assertions as they are no longer correct (cutting may generate valid 3 byte accesses). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
85dde9a90b
commit
42e4126b79
4 changed files with 34 additions and 14 deletions
|
@ -39,6 +39,12 @@ struct PCIHostState {
|
|||
PCIBus *bus;
|
||||
};
|
||||
|
||||
/* common internal helpers for PCI/PCIe hosts, cut off overflows */
|
||||
void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr,
|
||||
uint32_t limit, uint32_t val, uint32_t len);
|
||||
uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr,
|
||||
uint32_t limit, uint32_t len);
|
||||
|
||||
void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len);
|
||||
uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue