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]
Date:	Wed, 3 Aug 2016 11:55:25 +0200
From:	Radim Krčmář <rkrcmar@...hat.com>
To:	Wanpeng Li <kernellwp@...il.com>
Cc:	linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
	Wanpeng Li <wanpeng.li@...mail.com>,
	Paolo Bonzini <pbonzini@...hat.com>,
	Yunhong Jiang <yunhong.jiang@...el.com>
Subject: Re: [PATCH 1/2] KVM: lapic: fix access preemption timer stuff even
 if kernel_irqchip=off

2016-08-03 12:04+0800, Wanpeng Li:
> From: Wanpeng Li <wanpeng.li@...mail.com>
> 
> BUG: unable to handle kernel NULL pointer dereference at 000000000000008c
> IP: [<ffffffffc04e0180>] kvm_lapic_hv_timer_in_use+0x10/0x20 [kvm]
> PGD 0 
> Oops: 0000 [#1] SMP
> Call Trace:
>  kvm_arch_vcpu_load+0x86/0x260 [kvm]
>  vcpu_load+0x46/0x60 [kvm]
>  kvm_vcpu_ioctl+0x79/0x7c0 [kvm]
>  ? __lock_is_held+0x54/0x70
>  do_vfs_ioctl+0x96/0x6a0
>  ? __fget_light+0x2a/0x90
>  SyS_ioctl+0x79/0x90
>  do_syscall_64+0x7c/0x1e0
>  entry_SYSCALL64_slow_path+0x25/0x25
> RIP  [<ffffffffc04e0180>] kvm_lapic_hv_timer_in_use+0x10/0x20 [kvm]
>  RSP <ffff8800db1f3d70>
> CR2: 000000000000008c
> ---[ end trace a55fb79d2b3b4ee8 ]---
> 
> This can be reproduced steadily by kernel_irqchip=off.
> 
> We should not access preemption timer stuff if lapic is emulated in userspace.
> This patch fix it by avoiding access preemption timer stuff when kernel_irqchip=off.
> 
> Cc: Paolo Bonzini <pbonzini@...hat.com>
> Cc: Radim Krčmář <rkrcmar@...hat.com>
> Cc: Yunhong Jiang <yunhong.jiang@...el.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@...mail.com>
> ---

Reviewed-by: Radim Krčmář <rkrcmar@...hat.com>

> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> @@ -1348,6 +1348,9 @@ static void start_sw_tscdeadline(struct kvm_lapic *apic)
>  
>  bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu)

Btw, the "hv" in makes it look like it has something to do with Hyper-V.
What does "hv" stand for anyway?  Hardware Virtualized?

Thanks.

>  {
> +	if (!lapic_in_kernel(vcpu))
> +		return false;
> +
>  	return vcpu->arch.apic->lapic_timer.hv_timer_in_use;
>  }
>  EXPORT_SYMBOL_GPL(kvm_lapic_hv_timer_in_use);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ