• Maxim Levitsky's avatar
    KVM: x86: nSVM: fix potential NULL derefernce on nested migration · e1779c27
    Maxim Levitsky authored
    Turns out that due to review feedback and/or rebases
    I accidentally moved the call to nested_svm_load_cr3 to be too early,
    before the NPT is enabled, which is very wrong to do.
    
    KVM can't even access guest memory at that point as nested NPT
    is needed for that, and of course it won't initialize the walk_mmu,
    which is main issue the patch was addressing.
    
    Fix this for real.
    
    Fixes: 232f75d3 ("KVM: nSVM: call nested_svm_load_cr3 on nested state load")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20220207155447.840194-3-mlevitsk@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    e1779c27
nested.c 42.5 KB