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: <1381636737.3392.29.camel@edumazet-glaptop.roam.corp.google.com>
Date:	Sat, 12 Oct 2013 20:58:57 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	baker.kernel@...il.com
Cc:	davem@...emloft.net, kuznet@....inr.ac.ru, jmorris@...ei.org,
	yoshfuji@...ux-ipv6.org, kaber@...sh.net, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] fib_trie: remove duplicated rcu lock

On Sun, 2013-10-13 at 08:13 +0800, baker.kernel@...il.com wrote:
> From: "baker.zhang" <baker.kernel@...il.com>
> 
> fib_table_lookup has included the rcu lock protection.
> 
> Signed-off-by: baker.zhang <baker.kernel@...il.com>
> ---
>  net/ipv4/fib_frontend.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
> index b3f627a..0e9127d 100644
> --- a/net/ipv4/fib_frontend.c
> +++ b/net/ipv4/fib_frontend.c
> @@ -170,12 +170,10 @@ static inline unsigned int __inet_dev_addr_type(struct net *net,
>  	local_table = fib_get_table(net, RT_TABLE_LOCAL);
>  	if (local_table) {
>  		ret = RTN_UNICAST;
> -		rcu_read_lock();
>  		if (!fib_table_lookup(local_table, &fl4, &res, FIB_LOOKUP_NOREF)) {
>  			if (!dev || dev == res.fi->fib_dev)
>  				ret = res.type;
>  		}
> -		rcu_read_unlock();
>  	}

This looks very wrong.

res.fi could disappear, and we crash.




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