Hide Forgot
A flaw was found in QEMU. Because pvrdma unproperly mremap, a VM escape may be caused.
The flaw exists in pvrdma_map_to_pdir() in hw/rdma/vmw/pvrdma_cmd.c. It could occur while handling a 'PVRDMA_CMD_CREATE_MR' command through create_mr() handler, which ultimately calls pvrdma_map_to_pdir. There, mmerap() is called repeatedly in a while loop without properly checking whether the location of the new mapping exceeds a previously remapped memory region. static void *pvrdma_map_to_pdir(...) { .... curr_page = rdma_pci_dma_map(pdev, (dma_addr_t)tbl[0], TARGET_PAGE_SIZE); ... host_virt = mremap(curr_page, 0, length, MREMAP_MAYMOVE); ... addr_idx = 1; while (addr_idx < nchunks) { // nchunks may be > length/TARGET_PAGE_SIZE ... mremap(curr_page, 0, TARGET_PAGE_SIZE, MREMAP_MAYMOVE | MREMAP_FIXED, host_virt + TARGET_PAGE_SIZE * addr_idx); // may remap after host_virt + length ... addr_idx++; }
Upstream fix: https://lists.nongnu.org/archive/html/qemu-devel/2021-06/msg04148.html
Created qemu tracking bugs for this issue: Affects: fedora-all [bug 1973144]
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s): https://access.redhat.com/security/cve/cve-2021-3582