Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1246496pxj; Fri, 4 Jun 2021 09:28:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhMHI0ucDMTB365dRft+eXKBvcEwVnJtz5LmIZbu5r+hp7wNcfi/f446foSiX0l0K61MUz X-Received: by 2002:a05:6402:11d2:: with SMTP id j18mr5526043edw.135.1622824094507; Fri, 04 Jun 2021 09:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622824094; cv=none; d=google.com; s=arc-20160816; b=TyKW0zctOTvvTc8uDmEXagbrdDmRE3lzMHJvRwY4I3Tpu+8wpOdZFyNKM/+EhxgyFr sebrBJ4KIH/iR5utk9L7JGqBN9YAd1A4c/2nbp94tCHyvE0fH9Jn4yGwl0N+7Fi8BiqB +Vva/kuklebV0/NvlHTPX6dnyHGTUu7ABDnVRptIRZaimEyylj7EqrHxjb5Uk4J6OiVt 0PulsitwmPfY9OxYDuudtG/zSRCFPs+1q/YWEcPBJjVMljb5ifiI4yUBYO7zM1GuGAsK ak/3hkzkUWx1DlYz198rPCWwwOiLjcagEnrao5ohwngC1k5Gf5Ls5GJGJ067MDYugl0z jvpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=W/yIQyoWclb3XbH6UpBZF9mWUNtMhuOfsf+7nNRjZ4c=; b=ZHjZVet7GVGKm6WaRiEqJ/1mjcMMtWN7fAeg7y800PUQss/5FhngIDrNpfZpauabwV BHpSEfiqtGa4ICVBVY0M2XNqBXk3hBw7KrGLo8w3yq0FKo+derFIbRXCb3wxiTyIEW6C kQ4WWl1P+SitQO0L5VSMcY82tt4KAgK7gNyf/wwovCN1kxWEYSw24eqfPvnJOBBSYopO Ki8qs1yTWXU7gIhCt/oGvg/rtWi3/qexLVaiKPuxPG5HKlGGqwFYG50eFC/BG2gXltL2 /6QjMlqJ/mRgtI3hQdnP8Se04H36oMxrTvpFLRuDQOfHgduVZg4HHjwzSelmxToWULnY i4nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="u/C3vsg1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp35si3074143ejc.731.2021.06.04.09.27.50; Fri, 04 Jun 2021 09:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="u/C3vsg1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230426AbhFDQ0k (ORCPT + 99 others); Fri, 4 Jun 2021 12:26:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:44484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbhFDQ0k (ORCPT ); Fri, 4 Jun 2021 12:26:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7BBD461009; Fri, 4 Jun 2021 16:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622823893; bh=tGEhtfMeMa1I2VdnXeJu3t/MFpJB5vTP0886/BmM/04=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=u/C3vsg1oweCRt+elPVzxhp2DgSa2/3jYJ9+mcooqQhbTHLs6F+T0swU150kiPlNY 6qZQNLrg2ZwA5Ph6LLSR2doDH2oEpt4CKpMpRL3O31Tudj88EztoRN0Fe+T92S2Grx DhZSJaogoJURs3QYSxaOJj4+TG72VEqJyHG3cIzBCngzPtYWL6LmV3DLSLzJkjvB1F pMGStlcsYnW8XRXVzzgDooK0j3thLobM08fHupcW1xF4McWqwZiSU6zJWOv2bpPTfC Wj554+kX2eFKhdxj8dclc/HxW6ibXE4/qe9Dqtff6KvMS8g0yyt0mALAy6RWZvuVgR BNFqD9TORL8gw== Received: by pali.im (Postfix) id 512D9990; Fri, 4 Jun 2021 18:24:51 +0200 (CEST) Date: Fri, 4 Jun 2021 18:24:51 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Marc Zyngier Cc: Lorenzo Pieralisi , Thomas Petazzoni , Rob Herring , Bjorn Helgaas , Russell King , Marek =?utf-8?B?QmVow7pu?= , Remi Pommarel , Xogium , Tomasz Maciej Nowak , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 12/42] PCI: aardvark: Check for virq mapping when processing INTx IRQ Message-ID: <20210604162451.lzumwctjj6yoigey@pali> References: <20210506153153.30454-1-pali@kernel.org> <20210506153153.30454-13-pali@kernel.org> <87h7jeq4zo.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87h7jeq4zo.wl-maz@kernel.org> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 07 May 2021 10:15:39 Marc Zyngier wrote: > On Thu, 06 May 2021 16:31:23 +0100, > Pali Rohár wrote: > > > > It is possible that we receive spurious INTx interrupt. So add needed check > > before calling generic_handle_irq() function. > > > > Signed-off-by: Pali Rohár > > Reviewed-by: Marek Behún > > Cc: stable@vger.kernel.org > > --- > > drivers/pci/controller/pci-aardvark.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c > > index 362faddae935..e7089db11f79 100644 > > --- a/drivers/pci/controller/pci-aardvark.c > > +++ b/drivers/pci/controller/pci-aardvark.c > > @@ -1106,7 +1106,10 @@ static void advk_pcie_handle_int(struct advk_pcie *pcie) > > PCIE_ISR1_REG); > > > > virq = irq_find_mapping(pcie->irq_domain, i); > > - generic_handle_irq(virq); > > + if (virq) > > + generic_handle_irq(virq); > > + else > > + dev_err(&pcie->pdev->dev, "unexpected INT%c IRQ\n", (char)i+'A'); > > Please don't scream like this. This is the best way to get into a DoS > situation if you interrupt rate is high enough. At least rate-limit > it. Ok, I will fix it! Just to note that this code pattern is used also in other drivers. So other drivers should fixed too...