oss-sec mailing list archives

Re: Xen Security Advisory 378 v3 (CVE-2021-28694,CVE-2021-28695,CVE-2021-28696) - IOMMU page mapping issues on x86


From: Andrew Cooper <andrew.cooper3 () citrix com>
Date: Wed, 1 Sep 2021 15:15:42 +0100

On 01/09/2021 14:22, Jason Andryuk wrote:
On Wed, Sep 1, 2021 at 5:34 AM Xen.org security team <security () xen org> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

 Xen Security Advisory CVE-2021-28694,CVE-2021-28695,CVE-2021-28696 / XSA-378
                                   version 3

                   IOMMU page mapping issues on x86

UPDATES IN VERSION 3
====================

Warn about dom0=pvh breakage in Resolution section.

ISSUE DESCRIPTION
=================

Both AMD and Intel allow ACPI tables to specify regions of memory
which should be left untranslated, which typically means these
addresses should pass the translation phase unaltered.  While these
are typically device specific ACPI properties, they can also be
specified to apply to a range of devices, or even all devices.

On all systems with such regions Xen failed to prevent guests from
undoing/replacing such mappings (CVE-2021-28694).
Hi,

Is there a way to identify if a system's ACPI tables have untranslated
regions?  Does it show up in xen or linux dmesg or can it be
identified in sysfs?

It's possible, but a little convoluted to do.  In dom0 (and in an empty
directory) you want:

acpidump > acpi.dmp
acpixtract -a acpi.dmp

On Intel, open up rmad.dat and hexedit the first 4 bytes from RMAD to
DMAR (yes - really - this is how we stop the dom0 kernel from trying to
poke the IOMMU directly.)

Then disassemble (iasl -d) either rmad.dat or ivrs.dat depending on
whether you're on Intel or AMD.

On Intel, you're looking for Reserved Memory Regions, while on AMD
you're looking for IVMD ranges (specifically, types 20 thru 22)

These, if present, describe a range of memory needing identity mapping,
and a scope of the PCI device(s) the range applies to.

~Andrew


Current thread: