Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1249126pxj; Fri, 4 Jun 2021 09:31:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoFyyaVdDND8DUHI3zT5syNljVgna23cqgfL6EYC9Hx8rdfup7xRyclppv/C7NG8WaAiGE X-Received: by 2002:a17:906:d1ce:: with SMTP id bs14mr5085266ejb.183.1622824315527; Fri, 04 Jun 2021 09:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622824315; cv=none; d=google.com; s=arc-20160816; b=HpO8w/pzPwDFcZKpM3m9HUBps9NuvN8XH5KerCKSGHFZRrsmgSgNAJTRbVLibpumN4 loCRDlA8iK80+r0wuZPZgT5BFbR3FMcfYY0wGvqzuSKbRJJ/hABHpNK2gB84aL+7r0YM h8GXKMsALQi+8p/RVni6yNvPtktQalBzTi4o6f5L/+UrsyuqJtplPOcAaH/zBBeolPZn UX8oUQefRW24Pej4gX5Tc99RTZSpreJqxU6OT166WYSpVSAXqnKRz+mS+wzkFVXLXk20 LNAXbsFRYb58LVCecCRUF8IB9f9nSSFop+gSUjIt59HDOvZFaszp985TbICPMywANFZK MRZA== 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=SYYT21Ne1MEkA6Pz6cKxo5jC4t3Uf2d4H4Q4tJWnj+Y=; b=Oou7ggQTLinNO+nyH4/6nLHa8w5pQJUDoENVMEypCJePN1ABi5o/CAfmySV1BSfY1u i5+dE+6JdGZa2iZiI4WMnK8t/axxoew5ZZUSX0k+rn62j2AvciH7FGuxINK2NHqze+Oo NwxcKnxJoG5Bbpoh4pbHlKQxxdjCivg5J7d80oI+XMIWI5OoEdbGc2ebbNkDIcEX3lDJ 5QCTZXEHDP5DIMt9PQPHrkZe3HOxXieCQ3yvy92v6mWhu/DEgywv37cxGGIpS0Cjcvrf e7hqGShx37sRlmcj6f5nxvesx0dlq/dwAMefu00lHj2er9yP+CugDNQ55iQUkytwwATh 02Iw== 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 p13si4893532eja.162.2021.06.04.09.31.20; Fri, 04 Jun 2021 09:31:55 -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 S230037AbhFDQb1 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 4 Jun 2021 12:31:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:48574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbhFDQb1 (ORCPT ); Fri, 4 Jun 2021 12:31:27 -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 C0348610A8; Fri, 4 Jun 2021 16:29:40 +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 1lpChW-005WHH-Ru; Fri, 04 Jun 2021 17:29:39 +0100 Date: Fri, 04 Jun 2021 17:29:36 +0100 Message-ID: <87o8clzj7z.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: <20210604162451.lzumwctjj6yoigey@pali> References: <20210506153153.30454-1-pali@kernel.org> <20210506153153.30454-13-pali@kernel.org> <87h7jeq4zo.wl-maz@kernel.org> <20210604162451.lzumwctjj6yoigey@pali> 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 Fri, 04 Jun 2021 17:24:51 +0100, Pali Rohár wrote: > > 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... "We should fix the kernel" is a common theme. Please go ahead. M. -- Without deviation from the norm, progress is not possible.