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]
Message-ID: <4AF9B21E.50805@gmail.com>
Date:	Tue, 10 Nov 2009 19:34:06 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Stephen Hemminger <shemminger@...tta.com>
CC:	David Miller <davem@...emloft.net>,
	Oliver Hartkopp <oliver@...tkopp.net>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Lothar Wassmann <LW@...O-electronics.de>,
	netdev@...r.kernel.org
Subject: Re: [PATCH 10/10] CAN: use dev_get_by_index_rcu

Stephen Hemminger a écrit :
> Use new function to avoid doing read_lock().
> 
> Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
> 
> --- a/net/can/bcm.c	2009-11-10 09:45:16.301376272 -0800
> +++ b/net/can/bcm.c	2009-11-10 09:46:30.125005956 -0800
> @@ -139,13 +139,13 @@ static char *bcm_proc_getifname(char *re
>  	if (!ifindex)
>  		return "any";
>  
> -	read_lock(&dev_base_lock);
> -	dev = __dev_get_by_index(&init_net, ifindex);
> +	rcu_read_lock();
> +	dev = dev_get_by_index_rcu(&init_net, ifindex);
>  	if (dev)
>  		strcpy(result, dev->name);
>  	else
>  		strcpy(result, "???");
> -	read_unlock(&dev_base_lock);
> +	rcu_read_unlock();
>  
>  	return result;
>  }
> 

I was pretty sure I had already done this one...

Ah yes, that was planned after a bugfix for net-2.6.

Acked-by: Eric Dumazet <eric.dumazet@...il.com>

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