From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935184AbbCDHWN (ORCPT ); Wed, 4 Mar 2015 02:22:13 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43043 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932911AbbCDGSl (ORCPT ); Wed, 4 Mar 2015 01:18:41 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dominik Dingel , Cornelia Huck , David Hildenbrand , Christian Borntraeger Subject: [PATCH 3.18 127/151] KVM: s390: floating irqs: fix user triggerable endless loop Date: Tue, 3 Mar 2015 22:14:21 -0800 Message-Id: <20150304055518.264409240@linuxfoundation.org> X-Mailer: git-send-email 2.3.1 In-Reply-To: <20150304055457.084276421@linuxfoundation.org> References: <20150304055457.084276421@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Hildenbrand commit 8e2207cdd087ebb031e9118d1fd0902c6533a5e5 upstream. If a vm with no VCPUs is created, the injection of a floating irq leads to an endless loop in the kernel. Let's skip the search for a destination VCPU for a floating irq if no VCPUs were created. Reviewed-by: Dominik Dingel Reviewed-by: Cornelia Huck Signed-off-by: David Hildenbrand Signed-off-by: Christian Borntraeger Signed-off-by: Greg Kroah-Hartman --- arch/s390/kvm/interrupt.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -850,6 +850,8 @@ static int __inject_vm(struct kvm *kvm, list_add_tail(&inti->list, &iter->list); } atomic_set(&fi->active, 1); + if (atomic_read(&kvm->online_vcpus) == 0) + goto unlock_fi; sigcpu = find_first_bit(fi->idle_mask, KVM_MAX_VCPUS); if (sigcpu == KVM_MAX_VCPUS) { do {