Xen Security Advisory 226 (CVE-2017-12135) - multiple problems with transitive grants
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Xen Security Advisory CVE-2017-12135 / XSA-226
version 5
multiple problems with transitive grants
UPDATES IN VERSION 5
====================
Public release.
ISSUE DESCRIPTION
=================
1) Code to handle copy operations on transitive grants has built in retry logic, involving a function reinvoking itself with unchanged parameters. Such use assumes that the compiler would also translate this to a so called "tail call" when generating machine code. Empirically, this is not commonly the case, allowing for theoretically unbounded nesting of such function calls.
2) The reference counting and locking discipline for transitive grants is broken. Concurrent use of the transitive grant can leak references on the transitively-referenced grant.
IMPACT
======
A malicious or buggy guest may be able to crash Xen. Privilege escalation and information leaks cannot be ruled out. A malicious or buggy guest can leak references on grants it has been given, amounting to a DoS against the grantee.
VULNERABLE SYSTEMS
==================
All versions of Xen are vulnerable.
MITIGATION
==========
There is no known mitigation.
CREDITS
=======
This issue was discovered by Jan Beulich of SUSE.
The security team would also like to thank Amazon for helping to identify that the problems with transitive grants were deeper than originally believed.
RESOLUTION
==========
Applying the appropriate attached patch works around this issue by disabling transitive grants by default.
xsa226.patch xen-unstable, Xen 4.9.x, Xen 4.8.x xsa226-4.7.patch Xen 4.7.x xsa226-4.6.patch Xen 4.6.x xsa226-4.5.patch Xen 4.5.x
$ sha256sum xsa226* b09e07aaf422ae04a4ece5e2c5b5e54036cfae5b5c632bfc6953a0cacd6f60ff xsa226.patch ca8b92b2ff58b87e8bec137a34784cbf11e2820659046df6e1d71e23bf7e7dee xsa226-4.5.patch 28c7df7edabb91fb2f1fa3fc7d6906bfae75a6e701f1cd335baafaae3e087696 xsa226-4.6.patch fffcc0a4428723e6aea391ff4f1d27326b5a3763d2308cbde64e6a786502c702 xsa226-4.7.patch $
(The .meta file is a prototype machine-readable file for describing which patches are to be applied how.)
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBCAAGBQJZkuNKAAoJEIP+FMlX6CvZUHMIALQcTfo00unwBX9RO7lBy4na LSkFE9yaPtA/pg5RRGo7Nrwl2nIDRc6Xc0ZkhNm0rfi1gnR0htP3jyJXxkXv1sah jkBP0bZYfWDHRxSdVBbNNn8q0mhuanycFhVuEiu+vmTPKRUTyODkAdAoi/TkY9Iq XD24clIrjY2xIDO3pKbDTJUZ86rHD0nepHdnnvN2rywyBd2VkJfJWGavqHgs61XX j9jX0nI4Wcm4nQKx37MBUwwN3oYeEKrzYQY3+AGVKQEWuULP4sWRKhxZaqclCbfd Cx/9gACwPEORU6bRXE/vzlxn7Ks6yf2tqgNAGCTrZgwW8q3SFNASHzaAM3EXz3w= =VNkV
-----END PGP SIGNATURE-----
From: Andrew Cooper <[email protected]>
Subject: grant_table: Default to v1, and disallow transitive grants
The reference counting and locking discipline for transitive grants is broken. Their use is therefore declared out of security support.
This is XSA-226.
Transitive grants are expected to be unconditionally available with grant table v2. Hiding transitive grants alone is an ABI breakage for the guest. Modern versions of Linux and the Windows PV drivers use grant table v1, but older versions did use v2.
In principle, disabling gnttab v2 entirely is the safer way to cause guests to avoid using transitive grants. However, some older guests which defaulted to using gnttab v2 don't tolerate falling back from v2 to v1 over migrate.
This patch introduces a new command line option to control grant table behaviour. One suboption allows a choice of the maximum grant table version Xen will allow the guest to use, and defaults to v2. A different suboption independently controls whether transitive grants can be used.
The default case is:
gnttab=max_ver:2
To disable gnttab v2 entirely, use:
gnttab=max_ver:1
To allow gnttab v2 and transitive grants, use:
gnttab=max_ver:2,transitive
docs/misc/xen-command-line.markdown +16 -0
@@ -868,6 +868,22 @@ Controls EPT related features. Specify which console gdbstub should use. See **console**. +### gnttab +> `= List of [ max_ver:<integer>, transitive ]` + +> Default: `gnttab=max_ver:2,no-transitive` + +Control various aspects of the grant table behaviour available to guests. + +* `max_ver` Select the maximum grant table version to offer to guests. Valid +version are 1 and 2. +* `transitive` Permit or disallow the use of transitive grants. Note that the +use of grant table v2 without transitive grants is an ABI breakage from the +guests point of view. + +*Warning:* +Due to XSA-226, the use of transitive grants is outside of security support. + ### gnttab\_max\_frames > `= <integer>`
xen/common/grant_table.c +44 -1
63 lines not on this page · raw message
From: Andrew Cooper <[email protected]>
Subject: grant_table: Default to v1, and disallow transitive grants
The reference counting and locking discipline for transitive grants is broken. Their use is therefore declared out of security support.
This is XSA-226.
Transitive grants are expected to be unconditionally available with grant table v2. Hiding transitive grants alone is an ABI breakage for the guest. Modern versions of Linux and the Windows PV drivers use grant table v1, but older versions did use v2.
In principle, disabling gnttab v2 entirely is the safer way to cause guests to avoid using transitive grants. However, some older guests which defaulted to using gnttab v2 don't tolerate falling back from v2 to v1 over migrate.
This patch introduces a new command line option to control grant table behaviour. One suboption allows a choice of the maximum grant table version Xen will allow the guest to use, and defaults to v2. A different suboption independently controls whether transitive grants can be used.
The default case is:
gnttab=max_ver:2
To disable gnttab v2 entirely, use:
gnttab=max_ver:1
To allow gnttab v2 and transitive grants, use:
gnttab=max_ver:2,transitive
docs/misc/xen-command-line.markdown +16 -0
@@ -662,6 +662,22 @@ does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT. Specify the serial parameters for the GDB stub. +### gnttab +> `= List of [ max_ver:<integer>, transitive ]` + +> Default: `gnttab=max_ver:2,no-transitive` + +Control various aspects of the grant table behaviour available to guests. + +* `max_ver` Select the maximum grant table version to offer to guests. Valid +version are 1 and 2. +* `transitive` Permit or disallow the use of transitive grants. Note that the +use of grant table v2 without transitive grants is an ABI breakage from the +guests point of view. + +*Warning:* +Due to XSA-226, the use of transitive grants is outside of security support. + ### gnttab\_max\_frames > `= <integer>`
xen/common/grant_table.c +44 -1
63 lines not on this page · raw message
From: Andrew Cooper <[email protected]>
Subject: grant_table: Default to v1, and disallow transitive grants
The reference counting and locking discipline for transitive grants is broken. Their use is therefore declared out of security support.
This is XSA-226.
Transitive grants are expected to be unconditionally available with grant table v2. Hiding transitive grants alone is an ABI breakage for the guest. Modern versions of Linux and the Windows PV drivers use grant table v1, but older versions did use v2.
In principle, disabling gnttab v2 entirely is the safer way to cause guests to avoid using transitive grants. However, some older guests which defaulted to using gnttab v2 don't tolerate falling back from v2 to v1 over migrate.
This patch introduces a new command line option to control grant table behaviour. One suboption allows a choice of the maximum grant table version Xen will allow the guest to use, and defaults to v2. A different suboption independently controls whether transitive grants can be used.
The default case is:
gnttab=max_ver:2
To disable gnttab v2 entirely, use:
gnttab=max_ver:1
To allow gnttab v2 and transitive grants, use:
gnttab=max_ver:2,transitive
docs/misc/xen-command-line.markdown +16 -0
@@ -733,6 +733,22 @@ Controls EPT related features. Specify the serial parameters for the GDB stub. +### gnttab +> `= List of [ max_ver:<integer>, transitive ]` + +> Default: `gnttab=max_ver:2,no-transitive` + +Control various aspects of the grant table behaviour available to guests. + +* `max_ver` Select the maximum grant table version to offer to guests. Valid +version are 1 and 2. +* `transitive` Permit or disallow the use of transitive grants. Note that the +use of grant table v2 without transitive grants is an ABI breakage from the +guests point of view. + +*Warning:* +Due to XSA-226, the use of transitive grants is outside of security support. + ### gnttab\_max\_frames > `= <integer>`
xen/common/grant_table.c +44 -1
63 lines not on this page · raw message
From: Andrew Cooper <[email protected]>
Subject: grant_table: Default to v1, and disallow transitive grants
The reference counting and locking discipline for transitive grants is broken. Their use is therefore declared out of security support.
This is XSA-226.
Transitive grants are expected to be unconditionally available with grant table v2. Hiding transitive grants alone is an ABI breakage for the guest. Modern versions of Linux and the Windows PV drivers use grant table v1, but older versions did use v2.
In principle, disabling gnttab v2 entirely is the safer way to cause guests to avoid using transitive grants. However, some older guests which defaulted to using gnttab v2 don't tolerate falling back from v2 to v1 over migrate.
This patch introduces a new command line option to control grant table behaviour. One suboption allows a choice of the maximum grant table version Xen will allow the guest to use, and defaults to v2. A different suboption independently controls whether transitive grants can be used.
The default case is:
gnttab=max_ver:2
To disable gnttab v2 entirely, use:
gnttab=max_ver:1
To allow gnttab v2 and transitive grants, use:
gnttab=max_ver:2,transitive
docs/misc/xen-command-line.markdown +16 -0
@@ -758,6 +758,22 @@ Controls EPT related features. Specify which console gdbstub should use. See **console**. +### gnttab +> `= List of [ max_ver:<integer>, transitive ]` + +> Default: `gnttab=max_ver:2,no-transitive` + +Control various aspects of the grant table behaviour available to guests. + +* `max_ver` Select the maximum grant table version to offer to guests. Valid +version are 1 and 2. +* `transitive` Permit or disallow the use of transitive grants. Note that the +use of grant table v2 without transitive grants is an ABI breakage from the +guests point of view. + +*Warning:* +Due to XSA-226, the use of transitive grants is outside of security support. + ### gnttab\_max\_frames > `= <integer>`
xen/common/grant_table.c +44 -1
63 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel