mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Juergen Gross <jgross@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@suse.de>,
	Mike Latimer <mlatimer@suse.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] x86/pti: don't report XenPV as vulnerable
Date: Mon, 18 Jun 2018 09:59:54 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.YFH.7.76.1806180959080.6203@cbobk.fhfr.pm> (raw)
In-Reply-To: <c8d238e9-2109-3fd2-01b8-37a7c5815fce@suse.com>

From: Jiri Kosina <jkosina@suse.cz>

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 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>
---

v1 -> v2: reporting "Not affected" is not really correct, as it depends on
	  the presence of mitigation in the hypervisor

 arch/x86/kernel/cpu/bugs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index cd0fda1fff6d..57638396a254 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -27,6 +27,7 @@
 #include <asm/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/intel-family.h>
+#include <asm/hypervisor.h>
 
 static void __init spectre_v2_select_mitigation(void);
 static void __init ssb_select_mitigation(void);
@@ -664,6 +665,10 @@ 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 (hypervisor_is_type(X86_HYPER_XEN_PV))
+			return sprintf(buf, "Unknown (XEN PV detected, hypervisor "
+					    "mitigation required)\n");
+
 		break;
 
 	case X86_BUG_SPECTRE_V1:
-- 
2.12.3

-- 
Jiri Kosina
SUSE Labs


  reply	other threads:[~2018-06-18  8:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 22:32 [PATCH] " Jiri Kosina
2018-06-15  5:46 ` Juergen Gross
2018-06-15  6:04   ` Jiri Kosina
2018-06-15  6:10     ` Juergen Gross
2018-06-15  6:16       ` Jiri Kosina
2018-06-15  6:30         ` Juergen Gross
2018-06-15  6:39           ` Jiri Kosina
2018-06-15  7:00             ` Juergen Gross
2018-06-15 21:10               ` Jiri Kosina
2018-06-16  6:36                 ` Juergen Gross
2018-06-18  7:59                   ` Jiri Kosina [this message]
2018-06-18  8:07                     ` [PATCH v2] " Juergen Gross
2018-06-19  8:02                     ` [tip:x86/pti] x86/pti: Don't " tip-bot for Jiri Kosina
2018-06-21 12:24                     ` tip-bot for Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YFH.7.76.1806180959080.6203@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=bp@suse.de \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mlatimer@suse.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®