Bug 1443222 (CVE-2017-8903, xsa213)

Summary: CVE-2017-8903 xsa213 xen: x86: 64bit PV guest breakout via pagetable use-after-mode-change (XSA-213)
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: ableisch, ailan, cww, dkholia, drjones, imammedo, knoel, m.a.young, mrezanin, pbonzini, rkrcmar, robinlee.sysu, security-response-team, sfroemer, virt-maint, vkuznets, xen-maint
Target Milestone: ---Keywords: Reopened, Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-11 04:17:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1447345    
Bug Blocks:    

Description Adam Mariš 2017-04-18 19:19:11 UTC
ISSUE DESCRIPTION
=================

64-bit PV guests typically use separate (root) page tables for their
kernel and user modes.  Hypercalls are accessible to guest kernel
context only, which certain hypercall handlers make assumptions on.
The IRET hypercall (replacing the identically name CPU instruction)
is used by guest kernels to transfer control from kernel mode to user
mode.  If such an IRET hypercall is placed in the middle of a multicall
batch, subsequent operations invoked by the same multicall batch may
wrongly assume the guest to still be in kernel mode.  If one or more of
these subsequent operations involve operations on page tables, they may
be using the wrong root page table, confusing internal accounting.  As
a result the guest may gain writable access to some of its page tables.

IMPACT
======

A malicious or buggy 64-bit PV guest may be able to access all of
system memory, allowing for all of privilege escalation, host crashes,
and information leaks.

VULNERABLE SYSTEMS
==================

All 64-bit Xen versions are vulnerable.

Only x86 systems are affected.  ARM systems are not vulnerable.

The vulnerability is only exposed to 64-bit PV guests.  HVM guests and
32-bit PV guests can't exploit the vulnerability.

MITIGATION
==========

Running only HVM or 32-bit PV guests will avoid the vulnerability.

The vulnerability can be avoided if the guest kernel is controlled by
the host rather than guest administrator, provided that further steps
are taken to prevent the guest administrator from loading code into
the kernel (e.g. by disabling loadable modules etc) or from using
other mechanisms which allow them to run code at kernel privilege.

External References:

http://xenbits.xen.org/xsa/advisory-213.html

Acknowledgements:

Name: the Xen project
Upstream: Jann Horn (Google)

Comment 1 Adam Mariš 2017-05-02 13:17:27 UTC
Created xen tracking bugs for this issue:

Affects: fedora-all [bug 1447345]

Comment 2 Andrej Nemec 2017-05-03 07:03:36 UTC
References:

http://seclists.org/oss-sec/2017/q2/193