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: <20150506122314.GJ25248@pox.localdomain>
Date:	Wed, 6 May 2015 14:23:14 +0200
From:	Thomas Graf <tgraf@...g.ch>
To:	Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc:	netdev@...r.kernel.org, davem@...emloft.net, ebiederm@...ssion.com
Subject: Re: [PATCH net-next 5/6] netns: use a spin_lock to protect nsid
 management

On 05/06/15 at 11:58am, Nicolas Dichtel wrote:
> +/* Should be called with nsid_lock held. If a new id is assigned, the bool alloc
> + * is set to true, thus the caller knows that the new id must be notified via
> + * rtnl.
> + */
>  static int __peernet2id(struct net *net, struct net *peer, bool *alloc)
>  {
>  	int id = idr_for_each(&net->netns_ids, net_eq_idr, peer);
>  	bool alloc_it = *alloc;
>  
> -	ASSERT_RTNL();
> -
>  	*alloc = false;
>  
>  	/* Magic value for id 0. */

If split into __peernet2id() and __peernet2id_alloc() then this could
live with RCU protection I guess so we only take the lock when we
actually allocate.
--
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