Page MenuHomeFreeBSD

vmm: Fix routines which create maps of the guest physical address space
ClosedPublic

Authored by markj on Oct 21 2025, 5:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 26, 9:26 AM
Unknown Object (File)
Sat, Nov 22, 1:29 AM
Unknown Object (File)
Mon, Nov 17, 3:22 PM
Unknown Object (File)
Fri, Nov 14, 6:32 PM
Unknown Object (File)
Nov 5 2025, 12:11 AM
Unknown Object (File)
Nov 4 2025, 7:06 PM
Unknown Object (File)
Nov 3 2025, 4:17 PM
Unknown Object (File)
Nov 2 2025, 12:56 AM
Subscribers

Details

Summary

In vm_mmap_memseg(), use vm_map_insert() instead of vm_map_find().
Existing callers expect to map the GPA that they passed, whereas
vm_map_find() merely treats the GPA as a hint. Also check for overflow
and remove a test for first < 0 since "first" is unsigned.

In vmm_mmio_alloc(), return an error number instead of an object
pointer, since the sole caller doesn't need the pointer. As in
vm_mmap_memseg(), use vm_map_insert() instead of vm_map_find() and
validate parameters. This function is not directly reachable via
ioctl(), but we ought to be careful anyway.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68142
Build 65025: arc lint + arc unit

Event Timeline

markj requested review of this revision.Oct 21 2025, 5:49 PM
sys/amd64/vmm/vmm_mem_machdep.c
88

Might be do error = vm_mmap_to_errno(error);.

This revision is now accepted and ready to land.Oct 22 2025, 6:30 AM
This revision now requires review to proceed.Oct 27 2025, 2:55 PM
This revision is now accepted and ready to land.Oct 27 2025, 3:47 PM