diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e00dd0515a84874af7b55fd1a5f828180d721ee3..b9f55299ed7e1ac535f8236626c4d5642f4c093b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4489,8 +4489,10 @@ static bool emulator_get_segment(struct x86_emulate_ctxt *ctxt, u16 *selector, kvm_get_segment(emul_to_vcpu(ctxt), &var, seg); *selector = var.selector; - if (var.unusable) + if (var.unusable) { + memset(desc, 0, sizeof(*desc)); return false; + } if (var.g) var.limit >>= 12;