Commit d7874dfd authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov Committed by Yongqiang Liu
Browse files

x86/kvm: Disable kvmclock on all CPUs on shutdown

mainline inclusion
from mainline-v5.13-rc2
commit c02027b5
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I990A4
CVE: CVE-2021-47110

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c02027b5742b5aa804ef08a4a9db433295533046



--------------------------------

Currenly, we disable kvmclock from machine_shutdown() hook and this
only happens for boot CPU. We need to disable it for all CPUs to
guard against memory corruption e.g. on restore from hibernate.

Note, writing '0' to kvmclock MSR doesn't clear memory location, it
just prevents hypervisor from updating the location so for the short
while after write and while CPU is still alive, the clock remains usable
and correct so we don't need to switch to some other clocksource.

Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20210414123544.1060604-4-vkuznets@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarliwei <liwei728@huawei.com>
parent ce7ba9ee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment