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:	Fri, 16 Feb 2007 08:59:36 +0100
From:	Jarek Poplawski <jarkao2@...pl>
To:	Francois Romieu <romieu@...zoreil.com>
Cc:	jeff@...zik.org,
	Stephen Hemminger <shemminger@...ux-foundation.org>,
	akpm@...ux-foundation.org, netdev@...r.kernel.org,
	Ben Greear <greearb@...delatech.com>,
	Kyle Lucke <klucke@...ibm.com>,
	Raghavendra Koushik <raghavendra.koushik@...erion.com>,
	Al Viro <viro@....linux.org.uk>
Subject: Re: [PATCH 3/4] 8139too: RTNL and flush_scheduled_work deadlock

On 15-02-2007 23:37, Francois Romieu wrote:
> Your usual dont-flush_scheduled_work-with-RTNL-held stuff.
> 
> It is a bit different here since the thread runs permanently
> or is only occasionally kicked for recovery depending on the
> hardware revision.
> 
> Signed-off-by: Francois Romieu <romieu@...zoreil.com>
> ---
>  drivers/net/8139too.c |   40 +++++++++++++++++-----------------------
>  1 files changed, 17 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
> index 35ad5cf..99304b2 100644
> --- a/drivers/net/8139too.c
> +++ b/drivers/net/8139too.c
> @@ -1109,6 +1109,8 @@ static void __devexit rtl8139_remove_one (struct pci_dev *pdev)
>  
>  	assert (dev != NULL);
>  
> +	flush_scheduled_work();
> +

IMHO there should be rather cancel_rearming_delayed_work
instead of this.

>  	unregister_netdev (dev);
>  
>  	__rtl8139_cleanup_dev (dev);
> @@ -1603,18 +1605,21 @@ static void rtl8139_thread (struct work_struct *work)
>  	struct net_device *dev = tp->mii.dev;
>  	unsigned long thr_delay = next_tick;
>  
> +	rtnl_lock();
> +
> +	if (!netif_running(dev))
> +		goto out_unlock;

I wonder, why you don't do netif_running before
rtnl_lock? It's an atomic operation.

And I'm not sure if increasing rtnl_lock range
is really needed here.

Regards,
Jarek P.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ