Skip to contentSkip to conversation

Xen Security Advisory 9 (CVE-2012-2934) - PV guest host DoS (AMD erratum #121)

PATCH Xen.org security team 1 participant 1 message Jun 12, 2012

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

	     Xen Security Advisory CVE-2012-2934 / XSA-9
                            version 3

		   PV guest host Denial of Service

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

Public release. Previous versions were embargoed.

Remove leftover statement that CVE number had not been assigned. The correct CVE for this issue is CVE-2012-2934.

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

A Xen user has discovered that some older AMD CPUs can be made to lock up due to AMD processor erratum #121.

This issue was discovered during testing of the fix for XSA-7 (CVE-2012-0217). Although the two issues are unrelated the situations which can trigger them may overlap.

REFERENCES
==========

AMD Erratum #121 is described in "Revision Guide for AMD Athlon 64 and AMD Opteron Processors": http://support.amd.com/us/Processor_TechDocs/25759.pdf

IMPACT
======

A guest user or administrator of a 64 bit PV guest on a vulnerable system can cause the processor to lock up, leading to a Denial of Service attack against the host.

Systems which run only 32 bit guest kernels are not vulnerable.

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

The following 130nm and 90nm (DDR1-only) AMD processors are subject to this erratum:

* First-generation AMD-Opteron(tm) single and dual core processors in either 939 or 940 packages:
* AMD Opteron(tm) 100-Series Processors
* AMD Opteron(tm) 200-Series Processors
* AMD Opteron(tm) 800-Series Processors
* AMD Athlon(tm) processors in either 754, 939 or 940 packages
* AMD Sempron(tm) processor in either 754 or 939 packages
* AMD Turion(tm) Mobile Technology in 754 package

None of the affected processors support AMD SVM. Therefore, any system which has any HVM Xen guests is not vulnerable.

This issue does not affect Intel processors.

MITIGATION
==========

Running a 64 bit PV guest kernel (which must necessarily be host administrator controlled) which itself contains the fix for erratum #121 will prevent unprivileged users in guests from exploiting this issue. All Windows operating systems and current versions of the Linux and Solaris kernels, for example, are known to contain the fix for erratum #121.

There is no mitigation when running untrusted 64 bit guest kernels or against untrusted administrators of 64 bit guests.

Systems which run only 32 bit PV guest kernels are not vulnerable. Note that this may mean only booting known good kernels or vetting any user supplied kernels to ensure they are not 64 bit.

RESOLUTION
==========

There is no software fix for this issue. The workaround suggested by AMD in erratum #121 cannot be applied to Xen since the relevant address is under guest control.

Applying the patch will cause Xen to detect vulnerable systems and refuse to boot. A command line override is provided to allow users who accept the risks or who are able to mitigate as above to continue to do so. To activate the override add "allow_unsafe" to your hypervisor command line.

This change has been made to the staging Xen repositories:

  xen-unstable.hg      25481:bc2f3a848f9a
  xen-4.1-testing.hg   23301:a9c0a89c08f2
  xen-4.0-testing.hg   21592:e35c8bb53255

PATCH INFORMATION
=================

 xen-unstable                                xsa9-unstable.patch  
 Xen 4.1, 4.1.x                              xsa9-xen-4.1.patch
 Xen 4.0, 4.0.x                              xsa9-xen-4.0.patch
$ sha256sum xsa9-*.patch
b48a2f1d5a7eb52f8533dccfb8bf0d6d403609011c1dd5915bcfcea92a5e8873  xsa9-unstable.patch
8ec1fa01b8094750e908bd5992b451e5c2acbe97ea1061e20c9244909d960262  xsa9-xen-4.0.patch
cb7686178ec8a2f021c01ae9706bfb3f1f44a098dba5723f1a645d959da5f2f3  xsa9-xen-4.1.patch

NOTE REGARDING EMBARGO
======================

Due to the relationship between this issue and XSA-7 (CVE-2012-0217), we have concluded that this advisory should be under the same embargo as XSA-7.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJP1yzzAAoJEIP+FMlX6CvZXvgH/1og/ULBFEj1E5i7eySDdbMl RtFfxCXbtTcsUvBQNZ6oKLKYyumhfQPhGUyhq5epuxZVhFmYEHdztH3Gf1fQLXuN AhGLomV3vA5ANzs2Dc+jvMhM25VWGekZbqQCfV+3FhZEyiqneUGbVUrvIJlpe3LH b5g4gWgvPpsFUewTtR7MgqJgBbVi1KbIc69r1Fh3Y+i6/KczxDwGUXtcVv1BZ3HJ Qkts3oT2bEFiqUgPtZKdRnKJegRJGQipOueqQMzYO5xtzElqGJVuD9C01VK2Qxzh Og7jsvajNM+9ulw5tTkbc2p84KBKaV2zrivfLfptir5IZOhI6RN6v880iyrNvpw= =X3We
-----END PGP SIGNATURE-----

x86-64: detect processors subject to AMD erratum #121 and refuse to boot

Processors with this erratum are subject to a DoS attack by unprivileged guest users.

This is XSA-9 / CVE-2006-0744.

docs/misc/xen-command-line.markdown +10 -0
@@ -126,6 +126,16 @@ Override Xen's logic for choosing the AP
 there are more than 8 CPUs, Xen will switch to `bigsmp` over
 `default`.
 
+### allow\_unsafe
+> `= <boolean>`
+
+Force boot on potentially unsafe systems. By default Xen will refuse to boot on
+systems with the following errata:
+
+* AMD Erratum 121. Processors with this erratum are subject to a guest
+  triggerable Denial of Service. Override only if you trust all of your PV
+  guests.
+
 ### apic\_verbosity
 > `= verbose | debug`
 
xen/arch/x86/cpu/amd.c +8 -0
@@ -32,6 +32,9 @@
 static char opt_famrev[14];
 string_param("cpuid_mask_cpu", opt_famrev);
 
+static bool_t opt_allow_unsafe;
+boolean_param("allow_unsafe", opt_allow_unsafe);
+
 static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
 		unsigned int hi)
 {
@@ -478,6 +481,11 @@ static void __devinit init_amd(struct cp
 		clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
 
 #ifdef __x86_64__
+	if (cpu_has_amd_erratum(c, AMD_ERRATUM_121) && !opt_allow_unsafe)
+		panic("Xen will not boot on this CPU for security reasons.\n"
+		      "Pass \"allow_unsafe\" if you're trusting all your"
+		      " (PV) guest kernels.\n");
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
xen/include/asm-x86/amd.h +3 -0
@@ -127,6 +127,9 @@
 #define AMD_MODEL_RANGE_START(range)    (((range) >> 12) & 0xfff)
 #define AMD_MODEL_RANGE_END(range)      ((range) & 0xfff)
 
+#define AMD_ERRATUM_121                                                 \
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x3f, 0xf))
+
 #define AMD_ERRATUM_170                                                 \
     AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x67, 0xf))
 

x86-64: detect processors subject to AMD erratum #121 and refuse to boot

Processors with this erratum are subject to a DoS attack by unprivileged guest users.

This is XSA-9 / CVE-2006-0744.

xen/arch/x86/cpu/amd.c +8 -0
@@ -32,6 +32,9 @@
 static char opt_famrev[14];
 string_param("cpuid_mask_cpu", opt_famrev);
 
+static int opt_allow_unsafe;
+boolean_param("allow_unsafe", opt_allow_unsafe);
+
 static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
 		unsigned int hi)
 {
@@ -620,6 +623,11 @@ static void __devinit init_amd(struct cp
 		clear_bit(X86_FEATURE_MCE, c->x86_capability);
 
 #ifdef __x86_64__
+	if (cpu_has_amd_erratum(c, AMD_ERRATUM_121) && !opt_allow_unsafe)
+		panic("Xen will not boot on this CPU for security reasons.\n"
+		      "Pass \"allow_unsafe\" if you're trusting all your"
+		      " (PV) guest kernels.\n");
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
xen/include/asm-x86/amd.h +3 -0
@@ -127,6 +127,9 @@
 #define AMD_MODEL_RANGE_START(range)    (((range) >> 12) & 0xfff)
 #define AMD_MODEL_RANGE_END(range)      ((range) & 0xfff)
 
+#define AMD_ERRATUM_121                                                 \
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x3f, 0xf))
+
 #define AMD_ERRATUM_170                                                 \
     AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x67, 0xf))
 

x86-64: detect processors subject to AMD erratum #121 and refuse to boot

Processors with this erratum are subject to a DoS attack by unprivileged guest users.

This is XSA-9 / CVE-2006-0744.

xen/arch/x86/cpu/amd.c +8 -0
@@ -41,6 +41,9 @@ void start_svm(struct cpuinfo_x86 *c);
 integer_param("cpuid_mask_ext_ecx", opt_cpuid_mask_ext_ecx);
 integer_param("cpuid_mask_ext_edx", opt_cpuid_mask_ext_edx);
 
+static int opt_allow_unsafe;
+boolean_param("allow_unsafe", opt_allow_unsafe);
+
 static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
 		unsigned int hi)
 {
@@ -640,6 +643,11 @@ static void __devinit init_amd(struct cp
 		clear_bit(X86_FEATURE_MCE, c->x86_capability);
 
 #ifdef __x86_64__
+	if (cpu_has_amd_erratum(c, AMD_ERRATUM_121) && !opt_allow_unsafe)
+		panic("Xen will not boot on this CPU for security reasons.\n"
+		      "Pass \"allow_unsafe\" if you're trusting all your"
+		      " (PV) guest kernels.\n");
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 #endif
xen/include/asm-x86/amd.h +3 -0
@@ -127,6 +127,9 @@
 #define AMD_MODEL_RANGE_START(range)    (((range) >> 12) & 0xfff)
 #define AMD_MODEL_RANGE_END(range)      ((range) & 0xfff)
 
+#define AMD_ERRATUM_121                                                 \
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x3f, 0xf))
+
 #define AMD_ERRATUM_170                                                 \
     AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0x67, 0xf))