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
F173772474: D59823.id187142.diff
Mon, Sep 28, 7:16 AM
F173739773: D59823.diff
Mon, Sep 28, 1:36 AM
F173719507: D59823.id187344.diff
Sun, Sep 27, 10:40 PM
Unknown Object (File)
Sun, Sep 27, 6:29 AM
Unknown Object (File)
Sat, Sep 26, 9:52 PM
Unknown Object (File)
Sat, Sep 26, 7:19 PM
Unknown Object (File)
Sat, Sep 26, 9:28 AM
Unknown Object (File)
Fri, Sep 25, 9:08 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