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]
Message-ID: <CAHp75VdmeepjqAO422v9Hz0YoiGZDTcTLbykxxL-CtRuuOZWPg@mail.gmail.com>
Date:   Mon, 31 Jan 2022 18:25:14 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Hector Martin <marcan@...can.st>
Cc:     Kalle Valo <kvalo@...eaurora.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>,
        Arend van Spriel <aspriel@...il.com>,
        Franky Lin <franky.lin@...adcom.com>,
        Hante Meuleman <hante.meuleman@...adcom.com>,
        Wright Feng <wright.feng@...ineon.com>,
        Dmitry Osipenko <digetx@...il.com>,
        Sven Peter <sven@...npeter.dev>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Mark Kettenis <kettenis@...nbsd.org>,
        Rafał Miłecki <zajec5@...il.com>,
        Pieter-Paul Giesberts <pieter-paul.giesberts@...adcom.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Hans de Goede <hdegoede@...hat.com>,
        "John W. Linville" <linville@...driver.com>,
        "brian m. carlson" <sandals@...stytoothpaste.net>,
        "open list:TI WILINK WIRELES..." <linux-wireless@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" 
        <brcm80211-dev-list.pdl@...adcom.com>,
        SHA-cyfmac-dev-list@...ineon.com,
        Arend van Spriel <arend.vanspriel@...adcom.com>,
        Stable <stable@...r.kernel.org>
Subject: Re: [PATCH v4 6/9] brcmfmac: pcie: Fix crashes due to early IRQs

On Mon, Jan 31, 2022 at 6:08 PM Hector Martin <marcan@...can.st> wrote:
>
> The driver was enabling IRQs before the message processing was
> initialized. This could cause IRQs to come in too early and crash the
> driver. Instead, move the IRQ enable and hostready to a bus preinit
> function, at which point everything is properly initialized.

Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>

> Fixes: 9e37f045d5e7 ("brcmfmac: Adding PCIe bus layer support.")
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
> Reviewed-by: Arend van Spriel <arend.vanspriel@...adcom.com>
> Cc: stable@...r.kernel.org
> Signed-off-by: Hector Martin <marcan@...can.st>
> ---
>  .../wireless/broadcom/brcm80211/brcmfmac/pcie.c  | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> index c25f48db1f60..3ff4997e1c97 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> @@ -1315,6 +1315,18 @@ static void brcmf_pcie_down(struct device *dev)
>  {
>  }
>
> +static int brcmf_pcie_preinit(struct device *dev)
> +{
> +       struct brcmf_bus *bus_if = dev_get_drvdata(dev);
> +       struct brcmf_pciedev *buspub = bus_if->bus_priv.pcie;
> +
> +       brcmf_dbg(PCIE, "Enter\n");
> +
> +       brcmf_pcie_intr_enable(buspub->devinfo);
> +       brcmf_pcie_hostready(buspub->devinfo);
> +
> +       return 0;
> +}
>
>  static int brcmf_pcie_tx(struct device *dev, struct sk_buff *skb)
>  {
> @@ -1423,6 +1435,7 @@ static int brcmf_pcie_reset(struct device *dev)
>  }
>
>  static const struct brcmf_bus_ops brcmf_pcie_bus_ops = {
> +       .preinit = brcmf_pcie_preinit,
>         .txdata = brcmf_pcie_tx,
>         .stop = brcmf_pcie_down,
>         .txctl = brcmf_pcie_tx_ctlpkt,
> @@ -1795,9 +1808,6 @@ static void brcmf_pcie_setup(struct device *dev, int ret,
>
>         init_waitqueue_head(&devinfo->mbdata_resp_wait);
>
> -       brcmf_pcie_intr_enable(devinfo);
> -       brcmf_pcie_hostready(devinfo);
> -
>         ret = brcmf_attach(&devinfo->pdev->dev);
>         if (ret)
>                 goto fail;
> --
> 2.33.0
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ