netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Li RongQing <lirongqing@baidu.com>, netdev@vger.kernel.org
Subject: Re: [PATCH][net-next] ipv6: sanitize RCU usage on fib6_next
Date: Fri, 22 Feb 2019 17:35:55 -0500	[thread overview]
Message-ID: <ef1e192a-5ccc-6f67-d278-a0946e2d434b@gmail.com> (raw)
In-Reply-To: <1550828682-10608-1-git-send-email-lirongqing@baidu.com>

On 2/22/19 4:44 AM, Li RongQing wrote:
> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> index 6613d8dbb0e5..b73d40d68178 100644
> --- a/net/ipv6/ip6_fib.c
> +++ b/net/ipv6/ip6_fib.c
> @@ -1143,7 +1143,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
>  
>  		atomic_inc(&rt->fib6_ref);
>  		rcu_assign_pointer(rt->fib6_node, fn);
> -		rt->fib6_next = iter->fib6_next;
> +		rcu_assign_pointer(rt->fib6_next, iter->fib6_next);
>  		rcu_assign_pointer(*ins, rt);
>  		if (!info->skip_notify)
>  			inet6_rt_notify(RTM_NEWROUTE, rt, info, NLM_F_REPLACE);
> @@ -1761,7 +1761,9 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
>  	RT6_TRACE("fib6_del_route\n");
>  
>  	/* Unlink it */
> -	*rtp = rt->fib6_next;
> +	*rtp = rcu_dereference_protected(rt->fib6_next,
> +				    lockdep_is_held(&rt->fib6_table->tb6_lock));
> +
>  	rt->fib6_node = NULL;
>  	net->ipv6.rt6_stats->fib_rt_entries--;
>  	net->ipv6.rt6_stats->fib_discarded_routes++;
> 

There are a number of fib6_next references not using rcu api's. Why are
you only touching these 2?

  reply	other threads:[~2019-02-22 22:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  9:44 [PATCH][net-next] ipv6: sanitize RCU usage on fib6_next Li RongQing
2019-02-22 22:35 ` David Ahern [this message]
2019-02-22 23:08 ` Eric Dumazet
2019-02-24  3:19 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef1e192a-5ccc-6f67-d278-a0946e2d434b@gmail.com \
    --to=dsahern@gmail.com \
    --cc=lirongqing@baidu.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).