Page MenuHomeFreeBSD

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

Authored by markj on Tue, Oct 21, 5:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 5, 12:11 AM
Unknown Object (File)
Tue, Nov 4, 7:06 PM
Unknown Object (File)
Mon, Nov 3, 4:17 PM
Unknown Object (File)
Sun, Nov 2, 12:56 AM
Unknown Object (File)
Sat, Nov 1, 7:44 PM
Unknown Object (File)
Sat, Nov 1, 7:02 PM
Unknown Object (File)
Sat, Nov 1, 5:29 PM
Unknown Object (File)
Fri, Oct 31, 12:05 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.Tue, Oct 21, 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.Wed, Oct 22, 6:30 AM
This revision now requires review to proceed.Mon, Oct 27, 2:55 PM
This revision is now accepted and ready to land.Mon, Oct 27, 3:47 PM