From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758588AbbCDGO4 (ORCPT ); Wed, 4 Mar 2015 01:14:56 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41970 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758564AbbCDGOx (ORCPT ); Wed, 4 Mar 2015 01:14:53 -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.10 42/53] KVM: s390: floating irqs: fix user triggerable endless loop Date: Tue, 3 Mar 2015 22:06:45 -0800 Message-Id: <20150304054616.976587208@linuxfoundation.org> X-Mailer: git-send-email 2.3.1 In-Reply-To: <20150304054609.869052846@linuxfoundation.org> References: <20150304054609.869052846@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.10-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 @@ -736,6 +736,8 @@ int kvm_s390_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 {