mem_sharing: allow forking domain with IOMMU enabled
authorTamas K Lengyel <tamas.lengyel@intel.com>
Thu, 23 Apr 2020 08:03:18 +0000 (10:03 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 23 Apr 2020 08:03:18 +0000 (10:03 +0200)
commitbb215898d46395080b911c15e5c3a7fff0c150cb
tree5d53a3382d498a49aff0dbb15b27519c00448fe0
parent732571959f171638b5161c9ba0d557f7b6da74f4
mem_sharing: allow forking domain with IOMMU enabled

The memory sharing subsystem by default doesn't allow a domain to share memory
if it has an IOMMU active for obvious security reasons. However, when fuzzing a
VM fork, the same security restrictions don't necessarily apply. While it makes
no sense to try to create a full fork of a VM that has an IOMMU attached as only
one domain can own the pass-through device at a time, creating a shallow fork
without a device model is still very useful for fuzzing kernel-mode drivers.

By allowing the parent VM to initialize the kernel-mode driver with a real
device that's pass-through, the driver can enter into a state more suitable for
fuzzing. Some of these initialization steps are quite complex and are easier to
perform when a real device is present. After the initialization, shallow forks
can be utilized for fuzzing code-segments in the device driver that don't
directly interact with the device.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/mm/mem_sharing.c
xen/include/public/memory.h