Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363AbdIPUNL (ORCPT ); Sat, 16 Sep 2017 16:13:11 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:32753 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbdIPUNK (ORCPT ); Sat, 16 Sep 2017 16:13:10 -0400 X-IronPort-AV: E=Sophos;i="5.42,404,1500940800"; d="scan'208";a="693684947" From: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, sachinp@linux.vnet.ibm.com, Abdul Haleem , kvm@vger.kernel.org Subject: [PATCH] Revert "KVM: Don't accept obviously wrong gsi values via KVM_IRQFD" Date: Sat, 16 Sep 2017 22:12:24 +0200 Message-Id: <1505592744-31498-1-git-send-email-jschoenh@amazon.de> X-Mailer: git-send-email 2.3.1.dirty In-Reply-To: <04cde7c8-d41f-96e2-2b4b-2287b8f04bfc@amazon.de> References: <04cde7c8-d41f-96e2-2b4b-2287b8f04bfc@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1075 Lines: 32 This reverts commit 36ae3c0a36b7456432fedce38ae2f7bd3e01a563. The commit broke compilation on !CONFIG_HAVE_KVM_IRQ_ROUTING. Also, there may be cases with CONFIG_HAVE_KVM_IRQ_ROUTING, where larger gsi values make sense. As the commit was meant as an early indicator to user space that something is wrong, reverting just restores the previous behavior where overly large values are ignored when encountered (without any direct feedback). Reported-by: Abdul Haleem Signed-off-by: Jan H. Schönherr --- virt/kvm/eventfd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index c608ab4..f2ac53a 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -565,8 +565,6 @@ kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args) { if (args->flags & ~(KVM_IRQFD_FLAG_DEASSIGN | KVM_IRQFD_FLAG_RESAMPLE)) return -EINVAL; - if (args->gsi >= KVM_MAX_IRQ_ROUTES) - return -EINVAL; if (args->flags & KVM_IRQFD_FLAG_DEASSIGN) return kvm_irqfd_deassign(kvm, args); -- 2.3.1.dirty