lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YLAvcG59BgJ1i0+I@google.com>
Date:   Thu, 27 May 2021 23:46:56 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Wanpeng Li <kernellwp@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, kvm <kvm@...r.kernel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>
Subject: Re: [PATCH v3 1/2] KVM: X86: Fix warning caused by stale emulation
 context

On Fri, May 28, 2021, Wanpeng Li wrote:
> How about this?

Yep, perfect!  Sorry about the squash confusion.

> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index bbc4e04..dba8077 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -7226,6 +7226,11 @@ static void init_emulate_ctxt(struct kvm_vcpu *vcpu)
>         BUILD_BUG_ON(HF_SMM_MASK != X86EMUL_SMM_MASK);
>         BUILD_BUG_ON(HF_SMM_INSIDE_NMI_MASK != X86EMUL_SMM_INSIDE_NMI_MASK);
> 
> +       ctxt->interruptibility = 0;
> +       ctxt->have_exception = false;
> +       ctxt->exception.vector = -1;
> +       ctxt->perm_ok = false;
> +
>         init_decode_cache(ctxt);
>         vcpu->arch.emulate_regs_need_sync_from_vcpu = false;
>  }
> @@ -7561,11 +7566,6 @@ int x86_decode_emulated_instruction(struct
> kvm_vcpu *vcpu, int emulation_type,
>             kvm_vcpu_check_breakpoint(vcpu, &r))
>                 return r;
> 
> -       ctxt->interruptibility = 0;
> -       ctxt->have_exception = false;
> -       ctxt->exception.vector = -1;
> -       ctxt->perm_ok = false;
> -
>         ctxt->ud = emulation_type & EMULTYPE_TRAP_UD;
> 
>         r = x86_decode_insn(ctxt, insn, insn_len);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ