[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <79fc57ce-b43c-46f9-89cc-f45b1b954519@brocade.com>
Date: Tue, 21 Jun 2016 16:15:35 +0100
From: Robert Shearman <rshearma@...cade.com>
To: Lennert Buytenhek <buytenh@...tstofly.org>,
<netdev@...r.kernel.org>, David Ahern <dsa@...ulusnetworks.com>,
Roopa Prabhu <roopa@...ulusnetworks.com>
Subject: Re: [PATCH] mpls: Add missing RCU-bh read side critical section
locking in output path
On 20/06/16 19:05, Lennert Buytenhek wrote:
> From: David Barroso <dbarroso@...tly.com>
>
> When locally originated IP traffic hits a route that says to push
> MPLS labels, we'll get a call chain dst_output() -> lwtunnel_output()
> -> mpls_output() -> neigh_xmit() -> ___neigh_lookup_noref() where the
> last function in this chain accesses a RCU-bh protected struct
> neigh_table pointer without us ever having declared an RCU-bh read
> side critical section.
>
> As in case of locally originated IP traffic we'll be running in process
> context, with softirqs enabled, we can be preempted by a softirq at any
> time, and RCU-bh considers the completion of a softirq as signaling
> the end of any pending read-side critical sections, so if we do get a
> softirq here, we can end up with an unexpected RCU grace period and
> all the nastiness that that comes with.
>
> This patch makes neigh_xmit() take rcu_read_{,un}lock_bh() around the
> code that expects to be treated as an RCU-bh read side critical section.
>
> Signed-off-by: David Barroso <dbarroso@...tly.com>
> Signed-off-by: Lennert Buytenhek <lbuytenhek@...tly.com>
LGTM too.
Acked-by: Robert Shearman <rshearma@...cade.com>
Powered by blists - more mailing lists