lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-89a8f6d4904c8cf3ff8fee9fdaff392a6bbb8bf6@git.kernel.org>
Date:   Tue, 30 Jan 2018 15:00:45 -0800
From:   tip-bot for Vitaly Kuznetsov <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     vkuznets@...hat.com, luto@...nel.org, hpa@...or.com,
        mmorsy@...hat.com, pbonzini@...hat.com, sthemmin@...rosoft.com,
        rkagan@...tuozzo.com, Michael.H.Kelley@...rosoft.com,
        mingo@...nel.org, haiyangz@...rosoft.com, cavery@...hat.com,
        tglx@...utronix.de, kys@...rosoft.com, rkrcmar@...hat.com,
        linux-kernel@...r.kernel.org
Subject: [tip:x86/hyperv] x86/hyperv: Check for required priviliges in
 hyperv_init()

Commit-ID:  89a8f6d4904c8cf3ff8fee9fdaff392a6bbb8bf6
Gitweb:     https://git.kernel.org/tip/89a8f6d4904c8cf3ff8fee9fdaff392a6bbb8bf6
Author:     Vitaly Kuznetsov <vkuznets@...hat.com>
AuthorDate: Wed, 24 Jan 2018 14:23:31 +0100
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Tue, 30 Jan 2018 23:55:32 +0100

x86/hyperv: Check for required priviliges in hyperv_init()

In hyperv_init() its presumed that it always has access to VP index and
hypercall MSRs while according to the specification it should be checked if
it's allowed to access the corresponding MSRs before accessing them.

Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Stephen Hemminger <sthemmin@...rosoft.com>
Cc: kvm@...r.kernel.org
Cc: Radim Krčmář <rkrcmar@...hat.com>
Cc: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.com>
Cc: Roman Kagan <rkagan@...tuozzo.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: devel@...uxdriverproject.org
Cc: Paolo Bonzini <pbonzini@...hat.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: Cathy Avery <cavery@...hat.com>
Cc: Mohammed Gamal <mmorsy@...hat.com>
Link: https://lkml.kernel.org/r/20180124132337.30138-2-vkuznets@redhat.com

---
 arch/x86/hyperv/hv_init.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 189a398..21f9d53 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -110,12 +110,19 @@ static int hv_cpu_init(unsigned int cpu)
  */
 void hyperv_init(void)
 {
-	u64 guest_id;
+	u64 guest_id, required_msrs;
 	union hv_x64_msr_hypercall_contents hypercall_msr;
 
 	if (x86_hyper_type != X86_HYPER_MS_HYPERV)
 		return;
 
+	/* Absolutely required MSRs */
+	required_msrs = HV_X64_MSR_HYPERCALL_AVAILABLE |
+		HV_X64_MSR_VP_INDEX_AVAILABLE;
+
+	if ((ms_hyperv.features & required_msrs) != required_msrs)
+		return;
+
 	/* Allocate percpu VP index */
 	hv_vp_index = kmalloc_array(num_possible_cpus(), sizeof(*hv_vp_index),
 				    GFP_KERNEL);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ