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:	Mon, 12 Jan 2009 16:10:54 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	mike@...ineau.org
Cc:	oliver@...tkopp.net, jaswinder@...radead.org, jgarzik@...hat.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-next@...r.kernel.org, mchan@...adcom.com
Subject: Re: [PATCH -net-next 3/4] firmware: convert tg3 driver to
 request_firmware()

From: Michael Marineau <mike@...ineau.org>
Date: Wed, 7 Jan 2009 18:06:25 -0500

> -static void rfc2863_policy(struct net_device *dev)
> -{
> -	unsigned char operstate = default_operstate(dev);
> -
> -	if (operstate == dev->operstate)
> -		return;
> -
> -	write_lock_bh(&dev_base_lock);
> -
> -	switch(dev->link_mode) {
> -	case IF_LINK_MODE_DORMANT:
> -		if (operstate == IF_OPER_UP)
> -			operstate = IF_OPER_DORMANT;
> -		break;
> -
> -	case IF_LINK_MODE_DEFAULT:
> -	default:
> -		break;
> -	}
> -
> -	dev->operstate = operstate;
> -
> -	write_unlock_bh(&dev_base_lock);
> +	if (dev->link_mode == IF_LINK_MODE_DORMANT && netif_oper_up(dev))
> +		netif_userspace_dormant_on(dev);
> +	else
> +		netif_userspace_dormant_off(dev);
>  }

Michael, this doesn't work.

The whole point of taking the dev_base_lock is to freeze the state of
->link_mode, so that we can make a decision atomically based upon it's
value and without that value changing in the middle of the decision.


--
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