lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Nov 2020 15:45:18 -0600
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Martin Kaiser <martin@...ser.cx>
Cc:     Ley Foon Tan <ley.foon.tan@...el.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        rfi@...ts.rocketboards.org, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Nicolas Saenz Julienne <nsaenzjulienne@...e.de>,
        Jingoo Han <jingoohan1@...il.com>,
        Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
        Toan Le <toan@...amperecomputing.com>,
        Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH] PCI: altera-msi: Remove irq handler and data in one go

[+cc Florian, sorry, I hadn't seen your ack when I sent the below]

On Tue, Nov 10, 2020 at 03:21:36PM -0600, Bjorn Helgaas wrote:
> [+cc Nicolas, Jingoo, Gustavo, Toan]
> 
> On Sun, Nov 08, 2020 at 08:11:40PM +0100, Martin Kaiser wrote:
> > Replace the two separate calls for removing the irq handler and data with a
> > single irq_set_chained_handler_and_data() call.
> 
> This is similar to these:
> 
>   36f024ed8fc9 ("PCI/MSI: pci-xgene-msi: Consolidate chained IRQ handler install/remove")
>   5168a73ce32d ("PCI/keystone: Consolidate chained IRQ handler install/remove")
>   2cf5a03cb29d ("PCI/keystone: Fix race in installing chained IRQ handler")
> 
> and it seems potentially important that this removes the IRQ handler
> and data *atomically*, i.e., both are done while holding
> irq_get_desc_buslock().  
> 
> So I would use this:
> 
>   PCI: altera-msi: Fix race in installing chained IRQ handler
> 
>   Fix a race where a pending interrupt could be received and the handler
>   called before the handler's data has been setup by converting to
>   irq_set_chained_handler_and_data().
> 
>   See also 2cf5a03cb29d ("PCI/keystone: Fix race in installing chained
>   IRQ handler").
> 
> to make it clear that this is actually a bug fix, not just a cleanup.
> 
> Looks like this should also be done in dw_pcie_free_msi() and
> xgene_msi_hwirq_alloc() at the same time?
> 
> > Signed-off-by: Martin Kaiser <martin@...ser.cx>
> > ---
> >  drivers/pci/controller/pcie-altera-msi.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/pci/controller/pcie-altera-msi.c b/drivers/pci/controller/pcie-altera-msi.c
> > index e1636f7714ca..42691dd8ebef 100644
> > --- a/drivers/pci/controller/pcie-altera-msi.c
> > +++ b/drivers/pci/controller/pcie-altera-msi.c
> > @@ -204,8 +204,7 @@ static int altera_msi_remove(struct platform_device *pdev)
> >  	struct altera_msi *msi = platform_get_drvdata(pdev);
> >  
> >  	msi_writel(msi, 0, MSI_INTMASK);
> > -	irq_set_chained_handler(msi->irq, NULL);
> > -	irq_set_handler_data(msi->irq, NULL);
> > +	irq_set_chained_handler_and_data(msi->irq, NULL, NULL);
> >  
> >  	altera_free_domains(msi);
> >  
> > -- 
> > 2.20.1
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ