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-next>] [day] [month] [year] [list]
Date:	Tue, 18 Mar 2008 07:06:54 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Stephen Hemminger <shemminger@...tta.com>
Cc:	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] fib_trie: fix warning from rcu_assign_poinger

On Mon, Mar 17, 2008 at 02:27:06PM -0700, Stephen Hemminger wrote:
> This gets rid of a warning caused by the test in rcu_assign_pointer.
> I tried to fix rcu_assign_pointer, but that devolved into a long
> set of discussions about doing it right that came to no real solution.
> Since the test in rcu_assign_pointer for constant NULL would never succeed in
> fib_trie, just open code instead.

Indeed -- fooling gcc is nontrivial.  :-/

Acked-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>

> Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
> 
> ---
>  net/ipv4/fib_trie.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index a7d089e..ce6cb34 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -177,10 +177,13 @@ static inline struct tnode *node_parent_rcu(struct node *node)
>  	return rcu_dereference(ret);
>  }
> 
> +/* Same as rcu_assign_pointer
> + * but that macro() assumes that value is a pointer.
> + */
>  static inline void node_set_parent(struct node *node, struct tnode *ptr)
>  {
> -	rcu_assign_pointer(node->parent,
> -			   (unsigned long)ptr | NODE_TYPE(node));
> +	smp_wmb();
> +	node->parent = (unsigned long)ptr | NODE_TYPE(node);
>  }
> 
>  static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
> -- 
> 1.5.4.3
> 
--
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