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: <1425926828.8261.7.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Mon, 09 Mar 2015 11:47:08 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	David Miller <davem@...emloft.net>, edumazet@...gle.com,
	netdev@...r.kernel.org, stephen@...workplumber.org,
	nicolas.dichtel@...nd.com, roopa@...ulusnetworks.com,
	hannes@...essinduktion.org, ddutt@...ulusnetworks.com,
	vipin@...ulusnetworks.com, shmulik.ladkani@...il.com,
	dsahern@...il.com
Subject: Re: [PATCH net-next 6/6] tcp_metrics: Use a single hash table for
 all network namespaces.

On Mon, 2015-03-09 at 13:31 -0500, Eric W. Biederman wrote:

> @@ -1167,17 +1173,22 @@ static void __net_exit tcp_net_metrics_exit(struct net *net)
>  {
>  	unsigned int i;
>  
> -	for (i = 0; i < (1U << net->ipv4.tcp_metrics_hash_log) ; i++) {
> +	if (net != &init_net) {
> +		tcp_metrics_flush_all(net);
> +		return;
> +	}

Note this _very_ unlikely (read: not possible) that
tcp_net_metrics_exit() will ever be called on init_net

So I would remove all this code.

> +
> +	for (i = 0; i < (1U << tcp_metrics_hash_log) ; i++) {
>  		struct tcp_metrics_block *tm, *next;
>  
> -		tm = rcu_dereference_protected(net->ipv4.tcp_metrics_hash[i].chain, 1);
> +		tm = rcu_dereference_protected(tcp_metrics_hash[i].chain, 1);
>  		while (tm) {
>  			next = rcu_dereference_protected(tm->tcpm_next, 1);
>  			kfree(tm);
>  			tm = next;
>  		}
>  	}
> -	kvfree(net->ipv4.tcp_metrics_hash);
> +	kvfree(tcp_metrics_hash);
>  }
>  

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