Message ID | 1585575162-37912-2-git-send-email-ann.zhuangyanying@huawei.com |
---|---|
State | New |
Headers | show |
Series | [1/2] KVM: fix overflow of zero page refcount with ksm running | expand |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 7f9ee2929cfe..d49cdd6ca883 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -128,7 +128,8 @@ static bool largepages_enabled = true; bool kvm_is_reserved_pfn(kvm_pfn_t pfn) { if (pfn_valid(pfn)) - return PageReserved(pfn_to_page(pfn)); + return PageReserved(pfn_to_page(pfn)) && + !is_zero_pfn(pfn); return true; }