From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34568 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbeBWLLf (ORCPT ); Fri, 23 Feb 2018 06:11:35 -0500 Subject: Patch "KVM: arm/arm64: Fix spinlock acquisition in vgic_set_owner" has been added to the 4.14-stable tree To: marc.zyngier@arm.com, alexander.levin@verizon.com, christoffer.dall@linaro.org, gregkh@linuxfoundation.org, james.morse@arm.com Cc: , From: Date: Fri, 23 Feb 2018 12:10:34 +0100 Message-ID: <15193842345222@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled KVM: arm/arm64: Fix spinlock acquisition in vgic_set_owner to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kvm-arm-arm64-fix-spinlock-acquisition-in-vgic_set_owner.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Fri Feb 23 11:45:09 CET 2018 From: Marc Zyngier Date: Thu, 30 Nov 2017 17:00:30 +0000 Subject: KVM: arm/arm64: Fix spinlock acquisition in vgic_set_owner From: Marc Zyngier [ Upstream commit 7465894e90e5a47e0e52aa5f1f708653fc40020f ] vgic_set_owner acquires the irq lock without disabling interrupts, resulting in a lockdep splat (an interrupt could fire and result in the same lock being taken if the same virtual irq is to be injected). In practice, it is almost impossible to trigger this bug, but better safe than sorry. Convert the lock acquisition to a spin_lock_irqsave() and keep lockdep happy. Reported-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- virt/kvm/arm/vgic/vgic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/virt/kvm/arm/vgic/vgic.c +++ b/virt/kvm/arm/vgic/vgic.c @@ -454,6 +454,7 @@ int kvm_vgic_unmap_phys_irq(struct kvm_v int kvm_vgic_set_owner(struct kvm_vcpu *vcpu, unsigned int intid, void *owner) { struct vgic_irq *irq; + unsigned long flags; int ret = 0; if (!vgic_initialized(vcpu->kvm)) @@ -464,12 +465,12 @@ int kvm_vgic_set_owner(struct kvm_vcpu * return -EINVAL; irq = vgic_get_irq(vcpu->kvm, vcpu, intid); - spin_lock(&irq->irq_lock); + spin_lock_irqsave(&irq->irq_lock, flags); if (irq->owner && irq->owner != owner) ret = -EEXIST; else irq->owner = owner; - spin_unlock(&irq->irq_lock); + spin_unlock_irqrestore(&irq->irq_lock, flags); return ret; } Patches currently in stable-queue which might be from marc.zyngier@arm.com are queue-4.14/arm-dts-fix-omap4-hang-with-gps-connected-to-usb-by-using-wakeupgen.patch queue-4.14/kvm-arm-don-t-treat-unavailable-hyp-mode-as-an-error.patch queue-4.14/kvm-arm-arm64-fix-spinlock-acquisition-in-vgic_set_owner.patch