]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
UBUNTU: SAUCE: hv: don't reset hv_context.tsc_page on crash
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 27 Jan 2017 19:56:03 +0000 (14:56 -0500)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 31 Jan 2017 17:08:50 +0000 (15:08 -0200)
BugLink: http://bugs.launchpad.net/bugs/1630924
It may happen that secondary CPUs are still alive and resetting
hv_context.tsc_page will cause a consequent crash in read_hv_clock_tsc()
as we don't check for it being not NULL there. It is safe as we're not
freeing this page anyways.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 56ef6718a1d8d77745033c5291e025ce18504159)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/hv/hv.c

index ab1f466f91abed16e17a9774e26f950ee3edced2..60db5ff43a03f5c1f59e7c340b970ebe630c0a8f 100644 (file)
@@ -317,9 +317,10 @@ void hv_cleanup(bool crash)
 
                hypercall_msr.as_uint64 = 0;
                wrmsrl(HV_X64_MSR_REFERENCE_TSC, hypercall_msr.as_uint64);
-               if (!crash)
+               if (!crash) {
                        vfree(hv_context.tsc_page);
-               hv_context.tsc_page = NULL;
+                       hv_context.tsc_page = NULL;
+               }
        }
 #endif
 }