Skip to content

Commit 5693f3f

Browse files
vittyvkgregkh
authored andcommitted
hv: don't reset hv_context.tsc_page on crash
commit 56ef6718a1d8d77745033c5291e025ce18504159 upstream. 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> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 03e2fb9 commit 5693f3f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/hv/hv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,10 @@ void hv_cleanup(bool crash)
305305

306306
hypercall_msr.as_uint64 = 0;
307307
wrmsrl(HV_X64_MSR_REFERENCE_TSC, hypercall_msr.as_uint64);
308-
if (!crash)
308+
if (!crash) {
309309
vfree(hv_context.tsc_page);
310-
hv_context.tsc_page = NULL;
310+
hv_context.tsc_page = NULL;
311+
}
311312
}
312313
#endif
313314
}

0 commit comments

Comments
 (0)