]> git.baikalelectronics.ru Git - kernel.git/commit
net: mpls: rt_nhn_alive and nh_flags should be accessed using READ_ONCE
authorDavid Ahern <dsa@cumulusnetworks.com>
Fri, 31 Mar 2017 14:13:59 +0000 (07:13 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Apr 2017 03:21:44 +0000 (20:21 -0700)
commit2fb28021b00dacd5135a0438878ed59635fd5a07
tree9edfe97cac2f15e5c9372ecb276bef9b4a38446d
parentd385092736405eaef59bf8e3a3a622037ac7334d
net: mpls: rt_nhn_alive and nh_flags should be accessed using READ_ONCE

The number of alive nexthops for a route (rt->rt_nhn_alive) and the
flags for a next hop (nh->nh_flags) are modified by netdev event
handlers. The event handlers run with rtnl_lock held so updates are
always done with the lock held. The packet path accesses the fields
under the rcu lock. Since those fields can change at any moment in
the packet path, both fields should be accessed using READ_ONCE. Updates
to both fields should use WRITE_ONCE.

Update mpls_select_multipath (packet path) and mpls_ifdown and mpls_ifup
(event handlers) accordingly.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mpls/af_mpls.c
net/mpls/internal.h