[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJedcCzaQZfyNzx0tE40k4sK=wmC3hdQ07cUNXwk8nukMYdw2Q@mail.gmail.com>
Date: Tue, 14 Mar 2023 10:11:42 +0800
From: Zheng Hacker <hackerzheng666@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Zheng Wang <zyytlz.wz@....com>, timur@...nel.org,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
1395428693sheep@...il.com, alex000young@...il.com
Subject: Re: [PATCH net] net: qcom/emac: Fix use after free bug in emac_remove
due to race condition
Jakub Kicinski <kuba@...nel.org> 于2023年3月14日周二 08:00写道:
>
> On Fri, 10 Mar 2023 18:57:34 +0800 Zheng Wang wrote:
> > + netif_carrier_off(netdev);
> > + netif_tx_disable(netdev);
> > + cancel_work_sync(&adpt->work_thread);
> > unregister_netdev(netdev);
> > netif_napi_del(&adpt->rx_q.napi);
>
> same problem as in the natsemi driver
Hi Jakub,
Thanks for your reply. Here we schedule the work when handling IRQ
request, So I think we should add free_irq after netif_napi_del and move
the cancel_work_sync after that like:
netif_carrier_off(netdev);
netif_tx_disable(netdev);
unregister_netdev(netdev);
netif_napi_del(&adpt->rx_q.napi);
free_irq(adpt->irq.irq, &adpt->irq);
cancel_work_sync(&adpt->work_thread);
Apprecaite for your advice about the fix.
Best regards,
Zheng
Powered by blists - more mailing lists