===================================================================== CERT-Renater Note d'Information No. 2023/VULN468 _____________________________________________________________________ DATE : 15/11/2023 HARDWARE PLATFORM(S): / OPERATING SYSTEM(S): Systems running Xen. ===================================================================== https://xenbits.xen.org/xsa/advisory-445.html https://xenbits.xen.org/xsa/advisory-446.html _____________________________________________________________________ Xen Security Advisory CVE-2023-46835 / XSA-445 version 3 x86/AMD: mismatch in IOMMU quarantine page table levels UPDATES IN VERSION 3 ==================== Public release. ISSUE DESCRIPTION ================= The current setup of the quarantine page tables assumes that the quarantine domain (dom_io) has been initialized with an address width of DEFAULT_DOMAIN_ADDRESS_WIDTH (48) and hence 4 page table levels. However dom_io being a PV domain gets the AMD-Vi IOMMU page tables levels based on the maximum (hot pluggable) RAM address, and hence on systems with no RAM above the 512GB mark only 3 page-table levels are configured in the IOMMU. On systems without RAM above the 512GB boundary amd_iommu_quarantine_init() will setup page tables for the scratch page with 4 levels, while the IOMMU will be configured to use 3 levels only, resulting in the last page table directory (PDE) effectively becoming a page table entry (PTE), and hence a device in quarantine mode gaining write access to the page destined to be a PDE. Due to this page table level mismatch, the sink page the device gets read/write access to is no longer cleared between device assignment, possibly leading to data leaks. IMPACT ====== A device in quarantine mode can access data from previous quarantine page table usages, possibly leaking data used by previous domains that also had the device assigned. VULNERABLE SYSTEMS ================== All Xen versions supporting PCI passthrough are affected. Only x86 AMD systems with IOMMU hardware are vulnerable. Only x86 guests which have physical devices passed through to them can leverage the vulnerability. MITIGATION ========== Not passing through physical devices to guests will avoid the vulnerability. Not using quarantine scratch-page mode will avoid the vulnerability, but could result in other issues. CREDITS ======= This issue was discovered by Roger Pau Monné of XenServer. RESOLUTION ========== Applying the appropriate attached patch resolves this issue. Note that patches for released versions are generally prepared to apply to the stable branches, and may not apply cleanly to the most recent release tarball. Downstreams are encouraged to update to the tip of the stable branch before applying these patches. xsa445.patch xen-unstable xsa445-4.17.patch Xen 4.17.x xsa445-4.16.patch Xen 4.16.x xsa445-4.15.patch Xen 4.15.x $ sha256sum xsa445* 751892f1a603dbee7ecb82d046aee6d87bf10398f365d3880a7f7d32eb3d73c1 xsa445.patch 9ae729410504961578e679ba19931646802b213d026b6587fb1abb43b2629186 xsa445-4.15.patch 55fe5925741b650fe2583a1e9855ea66c4fe0212de4fe93535fd592188fa64d4 xsa445-4.16.patch 7c4478d348dad0d9c71685a8c402df78d74c6b4d3c3e1627115b91967e54d94a xsa445-4.17.patch $ DEPLOYMENT DURING EMBARGO ========================= Deployment of the patches and/or mitigations described above (or others which are substantially similar) is permitted during the embargo, even on public-facing systems with untrusted guest users and administrators. But: Distribution of updated software is prohibited (except to other members of the predisclosure list). Predisclosure list members who wish to deploy significantly different patches and/or mitigations, please contact the Xen Project Security Team. (Note: this during-embargo deployment notice is retained in post-embargo publicly released Xen Project advisories, even though it is then no longer applicable. This is to enable the community to have oversight of the Xen Project Security Team's decisionmaking.) For more information about permissible uses of embargoed information, consult the Xen Project community's agreed Security Policy: http://www.xenproject.org/security-policy.html _____________________________________________________________________ Xen Security Advisory CVE-2023-46836 / XSA-446 version 2 x86: BTC/SRSO fixes not fully effective UPDATES IN VERSION 2 ==================== Grammar fixes. Public release. ISSUE DESCRIPTION ================= The fixes for XSA-422 (Branch Type Confusion) and XSA-434 (Speculative Return Stack Overflow) are not IRQ-safe. It was believed that the mitigations always operated in contexts with IRQs disabled. However, the original XSA-254 fix for Meltdown (XPTI) deliberately left interrupts enabled on two entry paths; one unconditionally, and one conditionally on whether XPTI was active. As BTC/SRSO and Meltdown affect different CPU vendors, the mitigations are not active together by default. Therefore, there is a race condition whereby a malicious PV guest can bypass BTC/SRSO protections and launch a BTC/SRSO attack against Xen. IMPACT ====== An attacker in a PV guest might be able to infer the contents of memory belonging to other guests. VULNERABLE SYSTEMS ================== All versions of Xen are vulnerable. Xen is only vulnerable in default configurations on AMD and Hygon CPUs. Xen is not believed to be vulnerable in default configurations on CPUs from other hardware vendors. Only PV guests can leverage the vulnerability. MITIGATION ========== Running only HVM or PVH VMs will avoid the vulnerability. CREDITS ======= This issue was discovered by Andrew Cooper of XenServer. RESOLUTION ========== Applying the appropriate attached patch resolves this issue. Note that patches for released versions are generally prepared to apply to the stable branches, and may not apply cleanly to the most recent release tarball. Downstreams are encouraged to update to the tip of the stable branch before applying these patches. xsa446.patch xen-unstable - Xen 4.15.x $ sha256sum xsa446* ed27ad5f36af31233e25c80daefb8b0078eeb18cacbc1923fdd6f10f0b394201 xsa446.patch $ DEPLOYMENT DURING EMBARGO ========================= Deployment of the patches and/or mitigations described above (or others which are substantially similar) is permitted during the embargo, even on public-facing systems with untrusted guest users and administrators. But: Distribution of updated software is prohibited (except to other members of the predisclosure list). Predisclosure list members who wish to deploy significantly different patches and/or mitigations, please contact the Xen Project Security Team. (Note: this during-embargo deployment notice is retained in post-embargo publicly released Xen Project advisories, even though it is then no longer applicable. This is to enable the community to have oversight of the Xen Project Security Team's decisionmaking.) For more information about permissible uses of embargoed information, consult the Xen Project community's agreed Security Policy: http://www.xenproject.org/security-policy.html ========================================================= + CERT-RENATER | tel : 01-53-94-20-44 + + 23/25 Rue Daviel | fax : 01-53-94-20-41 + + 75013 Paris | email:cert@support.renater.fr + =========================================================