Page MenuHomeFreeBSD

D45335.diff
No OneTemporary

D45335.diff

diff --git a/usr.sbin/bhyve/amd64/pci_gvt-d.c b/usr.sbin/bhyve/amd64/pci_gvt-d.c
--- a/usr.sbin/bhyve/amd64/pci_gvt-d.c
+++ b/usr.sbin/bhyve/amd64/pci_gvt-d.c
@@ -222,6 +222,13 @@
opregion->len = header->size * KB;
munmap(header, sizeof(*header));
+ if (opregion->len != sizeof(struct igd_opregion)) {
+ warnx("%s: Invalid OpRegion size of 0x%lx", __func__,
+ opregion->len);
+ close(memfd);
+ return (-1);
+ }
+
opregion->hva = mmap(NULL, opregion->len, PROT_READ, MAP_SHARED, memfd,
opregion->hpa);
if (opregion->hva == MAP_FAILED) {

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 14, 5:10 PM (4 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14631446
Default Alt Text
D45335.diff (561 B)

Event Timeline