Page MenuHomeFreeBSD

vmm: Fix a page wiring leak in MOVS emulation
ClosedPublic

Authored by hayzam_gmail.com on Fri, Sep 18, 7:46 PM.
Tags
None
Referenced Files
F176024923: D59823.diff
Thu, Oct 15, 9:50 AM
Unknown Object (File)
Wed, Oct 14, 4:29 AM
Unknown Object (File)
Tue, Oct 13, 2:11 AM
Unknown Object (File)
Sun, Oct 11, 11:26 AM
Unknown Object (File)
Thu, Oct 8, 6:27 PM
Unknown Object (File)
Thu, Oct 8, 11:16 AM
Unknown Object (File)
Thu, Oct 8, 12:21 AM
Unknown Object (File)
Wed, Oct 7, 6:41 PM
Subscribers

Details

Summary

When emulating a MOVS from MMIO to guest RAM, the kernel's
vm_copy_setup() wires the destination pages. If the subsequent
MMIO read fails, emulate_movs() skips vm_copy_teardown(), leaking
the page wire references acquired during setup.

Run vm_copy_teardown() regardless of the MMIO read result, and
only copy the value to guest memory if the read succeeds.
Preserve the existing error return.

This matches illumos change 13309.

Obtained from: illumos 83cd75bb2949d26e6eb38ddefc60fdeed1909643
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable