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: <1410555114.7106.101.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Fri, 12 Sep 2014 13:51:54 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	John Fastabend <john.fastabend@...il.com>
Cc:	xiyou.wangcong@...il.com, davem@...emloft.net, jhs@...atatu.com,
	netdev@...r.kernel.org, paulmck@...ux.vnet.ibm.com,
	brouer@...hat.com
Subject: Re: [net-next PATCH v5 13/16] net: sched: make tc_action safe to
 walk under RCU

On Fri, 2014-09-12 at 09:34 -0700, John Fastabend wrote:

> Second there is a suspect usage of list_splice_init_rcu() in the
> tcf_exts_change() routine. Notice how it is used twice in succession
> and the second init works on the src tcf_exts. There is probably a
> better way to accomplish that.
> 


> +/* It is not safe to use src->actions after this due to _init_rcu usage
> + * INIT_LIST_HEAD_RCU() is called on src->actions
> + */
>  void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
>  		     struct tcf_exts *src)
>  {
>  #ifdef CONFIG_NET_CLS_ACT
>  	LIST_HEAD(tmp);
> -	tcf_tree_lock(tp);
> -	list_splice_init(&dst->actions, &tmp);
> -	list_splice(&src->actions, &dst->actions);
> -	tcf_tree_unlock(tp);
> +	list_splice_init_rcu(&dst->actions, &tmp, synchronize_rcu);
> +	list_splice_init_rcu(&src->actions,
> +			     &dst->actions,
> +			     synchronize_rcu);
>  	tcf_action_destroy(&tmp, TCA_ACT_UNBIND);
>  #endif
>  }

I am afraid I do not understand this part.


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