VT-d: fix (de)assign ordering when RMRRs are in use
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 12:15:33 +0000 (14:15 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 12:15:33 +0000 (14:15 +0200)
commit78a40f8b5dfa1a3aec43528663f39473d4429101
tree598c3e71641fc47ff618fb2acf5ae08fdd68c427
parentd9eca7bb6c6636eb87bb17b08ba7de270f47ecd0
VT-d: fix (de)assign ordering when RMRRs are in use

In the event that the RMRR mappings are essential for device operation,
they should be established before updating the device's context entry,
while they should be torn down only after the device's context entry was
successfully updated.

Also adjust a related log message.

This is CVE-2022-26358 / part of XSA-400.

Fixes: 8b99f4400b69 ("VT-d: fix RMRR related error handling")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c