Bug 1679321 (CVE-2019-17343) - CVE-2019-17343 xen: xsa288: Inconsistent PV IOMMU discipline
Summary: CVE-2019-17343 xen: xsa288: Inconsistent PV IOMMU discipline
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2019-17343
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1685577
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-20 21:19 UTC by Pedro Sampaio
Modified: 2019-11-12 09:49 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-10 10:48:25 UTC
Embargoed:


Attachments (Terms of Use)

Description Pedro Sampaio 2019-02-20 21:19:59 UTC
In order for a PV domain to set up DMA from a passed-through device to
one of its pages, the page must be mapped in the IOMMU. On the other
hand, before a PV page may be used as a "special" page type (such as a
pagetable or descriptor table), it _must not_ be writable in the IOMMU
(otherwise a malicious guest could DMA arbitrary page tables into the
memory, bypassing Xen's safety checks); and Xen's current rule is to
have such pages not in the IOMMU at all.

Until now, in order to accomplish this, the code has borrowed HVM
domain's "physmap" concept: When a page is assigned to a guest,
guess_physmap_add_entry() is called, which for PV guests, will create
a writable IOMMU mapping; and when a page is removed,
guest_physmap_remove_entry() is called, which will remove the mapping.

Additionally, when a page gains the PGT_writable page type, the page
will be added into the IOMMU; and when the page changes away from a
PGT_writable type, the page will be removed from the IOMMU.

Unfortunately, borrowing the "physmap" concept from HVM domains is
problematic. HVM domains have a lock on their p2m tables, ensuring
synchronization between modifications to the p2m; and all hypercall
parameters must first be translated through the p2m before being used.
Trying to mix this locked-and-gated approach with PV's lock-free
approach leads to several races and inconsistencies.

Comment 1 Andrej Nemec 2019-03-05 14:16:49 UTC
References:

https://seclists.org/oss-sec/2019/q1/162

Comment 2 Andrej Nemec 2019-03-05 14:26:44 UTC
Created xen tracking bugs for this issue:

Affects: fedora-all [bug 1685577]


Note You need to log in before you can comment on or make changes to this bug.