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] [day] [month] [year] [list]
Message-ID: <62bc2d26.1c69fb81.8efff.df8d@mx.google.com>
Date:   Wed, 29 Jun 2022 12:44:53 +0200
From:   Christian Marangi <ansuelsmth@...il.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Jose Abreu <joabreu@...opsys.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [net-next PATCH RFC 2/5] net: ethernet: stmicro: stmmac: first
 disable all queues in release

On Tue, Jun 28, 2022 at 08:54:35PM -0700, Jakub Kicinski wrote:
> On Tue, 28 Jun 2022 03:33:39 +0200 Christian Marangi wrote:
> > +	stmmac_disable_all_queues(priv);
> > +
> > +	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
> > +		hrtimer_cancel(&priv->tx_queue[chan].txtimer);
> 
> IIRC this hrtimer is to check for completions. Canceling it before
> netif_tx_disable() looks odd, presumably until the queues are stopped
> the timer can get scheduled again, no?
> 

My concern is that at the time hrtimer_cancel is called there may be
some packet that still has to be processed and this cause kernel panic
as stmmac_release free the descriptor (and tx_clean try to free garbage
pointer)

Bu honestly I put the hrtimer_cancel up to be extra safe, the main
problem here was disabling napi polling after tx_disable that I think
was wrong from the start.

> >  	netif_tx_disable(dev);
> >  
> >  	if (device_may_wakeup(priv->device))
> > @@ -3764,11 +3769,6 @@ static int stmmac_release(struct net_device *dev)
> >  	phylink_stop(priv->phylink);
> >  	phylink_disconnect_phy(priv->phylink);
> >  
> > -	stmmac_disable_all_queues(priv);
> > -
> > -	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
> > -		hrtimer_cancel(&priv->tx_queue[chan].txtimer);

-- 
	Ansuel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ