]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/pti: Don't report XenPV as vulnerable
authorJiri Kosina <jkosina@suse.cz>
Mon, 18 Jun 2018 07:59:54 +0000 (09:59 +0200)
committerBrian Maly <brian.maly@oracle.com>
Wed, 19 Sep 2018 00:30:25 +0000 (20:30 -0400)
Xen PV domain kernel is not by design affected by meltdown as it's
enforcing split CR3 itself. Let's not report such systems as "Vulnerable"
in sysfs (we're also already forcing PTI to off in X86_HYPER_XEN_PV cases);
the security of the system ultimately depends on presence of mitigation in
the Hypervisor, which can't be easily detected from DomU; let's report
that.

Reported-and-tested-by: Mike Latimer <mlatimer@suse.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Juergen Gross <jgross@suse.com>
Cc: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/nycvar.YFH.7.76.1806180959080.6203@cbobk.fhfr.pm
[ Merge the user-visible string into a single line. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 6cb2b08ff92460290979de4be91363e5d1b6cec1)

 Conflicts:
arch/x86/kernel/cpu/bugs.c

In UEK4, these changes are made in arch/x86/kernel/cpu/bugs_64.c.

Context around the headers was slightly different (there were some extra
headers relative to the cherry-picked patch).

There is noX86_HYPER_XEN_PV, instead compare x86_hyper to x86_hyper_xen.

Orabug: 28476681

Signed-off-by: Patrick Colp <patrick.colp@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kernel/cpu/bugs_64.c

index 215addb0979f3ad606bea0d10aaeae15e9c4b754..900fc409aea4b2d32e64e5a0a5c1fa36ae423927 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/spec-ctrl.h>
 #include <asm/cmdline.h>
 #include <asm/intel-family.h>
+#include <asm/hypervisor.h>
 #include <asm/e820.h>
 #include <asm/vmx.h>
 
@@ -1118,6 +1119,9 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
                if (boot_cpu_has(X86_FEATURE_PTI))
                        return sprintf(buf, "Mitigation: PTI\n");
 
+               if (x86_hyper == &x86_hyper_xen)
+                       return sprintf(buf, "Unknown (XEN PV detected, hypervisor mitigation required)\n");
+
                break;
 
        case X86_BUG_SPECTRE_V1: