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]
Date:   Sun, 24 Nov 2019 18:21:28 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Chuhong Yuan <hslester96@...il.com>
Cc:     Nicolas Ferre <nicolas.ferre@...rochip.com>,
        "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v3] net: macb: add missed tasklet_kill

On Sat, 23 Nov 2019 22:19:18 +0800, Chuhong Yuan wrote:
> This driver forgets to kill tasklet in remove.
> Add the call to fix it.
> 
> Fixes: 032dc41ba6e2 ("net: macb: Handle HRESP error")
> Signed-off-by: Chuhong Yuan <hslester96@...il.com>

I think this leaves a race condition, as far as I can tell
tasklet_kill() just kills the currently scheduled tasklet,
but doesn't prevent it from being scheduled again. If the 
interrupt fires just after the tasklet_kill() call the tasklet
will be scheduled back in. I think you'd need to mask the interrupt 
(through the IDR register?) or just put the tasklet_kill() call after
unregister_netdev(), because AFAICT closing the netdev disables all
irqs.

> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 1e1b774e1953..2ec416098fa3 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4383,6 +4383,7 @@ static int macb_remove(struct platform_device *pdev)
>  
>  	if (dev) {
>  		bp = netdev_priv(dev);
> +		tasklet_kill(&bp->hresp_err_tasklet);
>  		if (dev->phydev)
>  			phy_disconnect(dev->phydev);
>  		mdiobus_unregister(bp->mii_bus);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ