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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190830010615.GC27970@linux.intel.com>
Date:   Thu, 29 Aug 2019 18:06:15 -0700
From:   Sean Christopherson <sean.j.christopherson@...el.com>
To:     Jan Dakinevich <jan.dakinevich@...tuozzo.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Denis Lunev <den@...tuozzo.com>,
        Roman Kagan <rkagan@...tuozzo.com>,
        Denis Plotnikov <dplotnikov@...tuozzo.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        "x86@...nel.org" <x86@...nel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>
Subject: Re: [PATCH v3 1/2] KVM: x86: always stop emulation on page fault

On Thu, Aug 29, 2019 at 08:23:18AM +0000, Jan Dakinevich wrote:
> inject_emulated_exception() returns true if and only if nested page
> fault happens. However, page fault can come from guest page tables
> walk, either nested or not nested. In both cases we should stop an
> attempt to read under RIP and give guest to step over its own page
> fault handler.
> 
> Fixes: 6ea6e84 ("KVM: x86: inject exceptions produced by x86_decode_insn")

Commit ids should be at least 12 chars, the full tag should be

  Fixes: 6ea6e84309ca ("KVM: x86: inject exceptions produced by x86_decode_insn")

You can force this in your git config, e.g.

  git config --global core.abbrev 12

Both patches in this series should probably have

  Cc: <stable@...r.kernel.org>


Reviewed-and-tested-by: Sean Christopherson <sean.j.christopherson@...el.com>

> Cc: Denis Lunev <den@...tuozzo.com>
> Cc: Roman Kagan <rkagan@...tuozzo.com>
> Cc: Denis Plotnikov <dplotnikov@...tuozzo.com>
> Signed-off-by: Jan Dakinevich <jan.dakinevich@...tuozzo.com>
> ---
>  arch/x86/kvm/x86.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index b4cfd78..6bf7b55 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -6537,8 +6537,13 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu,
>  			if (reexecute_instruction(vcpu, cr2, write_fault_to_spt,
>  						emulation_type))
>  				return EMULATE_DONE;
> -			if (ctxt->have_exception && inject_emulated_exception(vcpu))
> +			if (ctxt->have_exception) {
> +				WARN_ON_ONCE(ctxt->exception.vector == UD_VECTOR);
> +				WARN_ON_ONCE(exception_type(ctxt->exception.vector)
> +					== EXCPT_TRAP);
> +				inject_emulated_exception(vcpu);
>  				return EMULATE_DONE;
> +			}
>  			if (emulation_type & EMULTYPE_SKIP)
>  				return EMULATE_FAIL;
>  			return handle_emulation_failure(vcpu, emulation_type);
> -- 
> 2.1.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ