Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp29776pxj; Fri, 7 May 2021 03:02:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp/hcQiTPN8NST/PwoDaeNW/Zn31LnYTdVmmYSBzijnXPz/TJCbob/OTwYdycEqLzkFsjw X-Received: by 2002:a17:906:e2d6:: with SMTP id gr22mr9328402ejb.356.1620381751729; Fri, 07 May 2021 03:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620381751; cv=none; d=google.com; s=arc-20160816; b=0+vpAmbeZpaCRGPVPGJ0+HmNzndveh6k+ALDgEj9uzkQBHofFP2mNYuj5z8D1o/VUd ignax3wMLiRLID274mIZXeylKqJHeXFtdS18whL5wgiWDmP8MIbQ786Fyvm2EO5rhTC5 i97ZLYwEFGbRYXNyb8u43VfCGkAJ0P6p14/gKt/Joog+aFqcYO6rI0F0nDMS4AAVG2WP MMGH7ATkwd1fiUhtznRjxJ2vTeNJ0CVOU8JcobGSuXxK4COEXDSlQYnVrHmNjiXZWcH7 LN9AQU7w2KUxsih3FVRfSGWs18YVkIVPYMpYGriETbiIjv19dsIckZb0eOFBEo9jF0qK j0vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date; bh=FDWc+F3WK2Q3N1BXaC61Rqu4+kCm/W7y8jpZV1PmBTY=; b=ozCazTE3nVamLScsyEzKNv042FkDtutLJ1+D7iBLo50SBnTr7qznDM7Co1T+zH2nJq B+n9LAkgX6thVpF5lprFX2Kluq1w2N2cMizg4Fl0XTc2yKg/Om2kuHEWINJeoXFD0o45 Ap/thBxYWGqOUfgAHolAwhBm2UMzC0bJm+PY1sdRdaXcAkVVm+MTuXul3zUNT4C/ej4x 26evNfpPsaVA3so/YzN0JyRK37PySX5Ov78ljuFhQ801VKK98Iezf6MhqUilI6UMsGKR ctA9VF+b9emsdKqKhFepoAI6asiA/NDgbxl9xDWLq8/OzV9RZtUKZzNyF1hIFT8N1bTi PvPw== ARC-Authentication-Results: i=1; mx.google.com; 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 w25si4275521eds.522.2021.05.07.03.02.03; Fri, 07 May 2021 03:02:31 -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; 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 S235811AbhEGJRa convert rfc822-to-8bit (ORCPT + 99 others); Fri, 7 May 2021 05:17:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:39486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235829AbhEGJQm (ORCPT ); Fri, 7 May 2021 05:16:42 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F3ED61426; Fri, 7 May 2021 09:15:42 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lewaC-00BQn9-4H; Fri, 07 May 2021 10:15:40 +0100 Date: Fri, 07 May 2021 10:15:39 +0100 Message-ID: <87h7jeq4zo.wl-maz@kernel.org> From: Marc Zyngier To: Pali =?UTF-8?B?Um9ow6Fy?= 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 In-Reply-To: <20210506153153.30454-13-pali@kernel.org> References: <20210506153153.30454-1-pali@kernel.org> <20210506153153.30454-13-pali@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: pali@kernel.org, lorenzo.pieralisi@arm.com, thomas.petazzoni@bootlin.com, robh@kernel.org, bhelgaas@google.com, rmk+kernel@armlinux.org.uk, kabel@kernel.org, repk@triplefau.lt, contact@xogium.me, tmn505@gmail.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. M. -- Without deviation from the norm, progress is not possible.