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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160129222130.GC10798@odin.com>
Date:	Fri, 29 Jan 2016 14:21:30 -0800
From:	Andrew Vagin <avagin@...tuozzo.com>
To:	Andrey Wagin <avagin@...il.com>
CC:	Paolo Bonzini <pbonzini@...hat.com>, <kvm@...r.kernel.org>,
	Oleg Nesterov <oleg@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>,
	"criu@...nvz.org" <criu@...nvz.org>,
	Cyrill Gorcunov <gorcunov@...nvz.org>
Subject: Re: [CRIU] x86: Hardware breakpoints are not always triggered

On Thu, Jan 28, 2016 at 02:42:25PM -0800, Andrey Wagin wrote:
> On Thu, Jan 28, 2016 at 10:33:28PM +0100, Paolo Bonzini wrote:
> > 
> > 
> > On 28/01/2016 09:31, Andrey Wagin wrote:
> > > I tried to print drX registers after a break-point. Looks like they
> > > are set correctly.
> > 
> > Can you try this KVM patch?
> 
> Looks like it fixes a case when reproducers are running only in VM.

Actually Oleg's reproducer detects the bug with this patch when they are
rinning only in VM.

> 
> If I execute the reproducer a few times on the host and then execute it
> in VM, it exits very fast.
> 
> Thanks,
> Andrew
> 
> > 
> > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> > index c13a64b7d789..32bae1c70a50 100644
> > --- a/arch/x86/kvm/svm.c
> > +++ b/arch/x86/kvm/svm.c
> > @@ -1612,6 +1612,7 @@ static void svm_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
> >  	vcpu->arch.dr7 = svm->vmcb->save.dr7;
> >  
> >  	vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_WONT_EXIT;
> > +	vcpu->arch.switch_db_regs |= KVM_DEBUGREG_RELOAD;
> >  	set_dr_intercepts(svm);
> >  }
> >  
> > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> > index e2951b6edbbc..505a4663b9f4 100644
> > --- a/arch/x86/kvm/vmx.c
> > +++ b/arch/x86/kvm/vmx.c
> > @@ -5659,6 +5659,7 @@ static void vmx_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
> >  	vcpu->arch.dr7 = vmcs_readl(GUEST_DR7);
> >  
> >  	vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_WONT_EXIT;
> > +	vcpu->arch.switch_db_regs |= KVM_DEBUGREG_RELOAD;
> >  
> >  	cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
> >  	cpu_based_vm_exec_control |= CPU_BASED_MOV_DR_EXITING;
> > 
> > Paolo
> _______________________________________________
> CRIU mailing list
> CRIU@...nvz.org
> https://lists.openvz.org/mailman/listinfo/criu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ