This is a note to let you know that I've just added the patch titled

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

to the 4.14-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-hyperv-check-for-required-priviliges-in-hyperv_init.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


From foo@baz Tue Apr 24 15:29:20 CEST 2018
From: Vitaly Kuznetsov <[email protected]>
Date: Wed, 24 Jan 2018 14:23:31 +0100
Subject: x86/hyperv: Check for required priviliges in hyperv_init()

From: Vitaly Kuznetsov <[email protected]>


[ Upstream commit 89a8f6d4904c8cf3ff8fee9fdaff392a6bbb8bf6 ]

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 <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: [email protected]
Cc: Radim Krčmář <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: "Michael Kelley (EOSG)" <[email protected]>
Cc: Roman Kagan <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: [email protected]
Cc: Paolo Bonzini <[email protected]>
Cc: "K. Y. Srinivasan" <[email protected]>
Cc: Cathy Avery <[email protected]>
Cc: Mohammed Gamal <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 arch/x86/hyperv/hv_init.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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


Patches currently in stable-queue which might be from [email protected] are

queue-4.14/x86-hyperv-stop-suppressing-x86_feature_pcid.patch
queue-4.14/x86-kvm-vmx-do-not-use-vm-exit-instruction-length-for-fast-mmio-when-running-nested.patch
queue-4.14/x86-hyperv-check-for-required-priviliges-in-hyperv_init.patch
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to