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, 24 Jan 2023 00:43:38 -0800
From:   Michael Chan <michael.chan@...adcom.com>
To:     Pavan Chebbi <pavan.chebbi@...adcom.com>
Cc:     David Christensen <drc@...ux.vnet.ibm.com>, netdev@...r.kernel.org,
        Siva Reddy Kallam <siva.kallam@...adcom.com>,
        Prashant Sreedharan <prashant@...adcom.com>,
        Michael Chan <mchan@...adcom.com>
Subject: Re: [PATCH] net/tg3: resolve deadlock in tg3_reset_task() during EEH

On Mon, Jan 23, 2023 at 11:25 PM Pavan Chebbi <pavan.chebbi@...adcom.com> wrote:
>
> On Tue, Jan 24, 2023 at 6:01 AM David Christensen
> <drc@...ux.vnet.ibm.com> wrote:
> >
> >
> > diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> > index 59debdc344a5..ee4604e6900e 100644
> > --- a/drivers/net/ethernet/broadcom/tg3.c
> > +++ b/drivers/net/ethernet/broadcom/tg3.c
> > @@ -11166,7 +11166,8 @@ static void tg3_reset_task(struct work_struct *work)
> >         rtnl_lock();
> >         tg3_full_lock(tp, 0);
> >
> > -       if (!netif_running(tp->dev)) {
> > +       // Skip reset task if no netdev or already in PCI recovery
> > +       if (!tp->dev || tp->pcierr_recovery || !netif_running(tp->dev)) {
>
> Thanks for the patch. Can we not use netif_device_present() here?

Take a look at the beginning of tg3_io_error_detected().  I think he
is trying to follow the same recipe there.  Basically, if a PCIe AER
has already been detected, then let it finish and do nothing here.

I don't think the tp->dev check is needed though.  We always call
tg3_reset_task_cancel() before we call unregister_netdev() and
free_netdev().

>
> >                 tg3_flag_clear(tp, RESET_TASK_PENDING);
> >                 tg3_full_unlock(tp);
> >                 rtnl_unlock();
> > @@ -18101,6 +18102,9 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,
> >
> >         netdev_info(netdev, "PCI I/O error detected\n");
> >
> > +       /* Want to make sure that the reset task doesn't run */
> > +       tg3_reset_task_cancel(tp);
> > +
> >         rtnl_lock();
> >
> >         /* Could be second call or maybe we don't have netdev yet */
> > @@ -18117,9 +18121,6 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,
> >
> >         tg3_timer_stop(tp);
> >
> > -       /* Want to make sure that the reset task doesn't run */
> > -       tg3_reset_task_cancel(tp);
> > -
> >         netif_device_detach(netdev);
> >
> >         /* Clean up software state, even if MMIO is blocked */
> > --
> > 2.31.1
> >

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ