OSDN Git Service

net/ipv6: Make from in rt6_info rcu protected
authorDavid Ahern <dsahern@gmail.com>
Fri, 20 Apr 2018 22:38:02 +0000 (15:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Apr 2018 20:06:14 +0000 (16:06 -0400)
commita68886a691804d3f6d479ebf6825480fbafb6a00
tree2240cab921badf927268bcd687b8b2743179e86c
parent5bcaa41b964ba2cda6dde64a126bfb7da1bd88f8
net/ipv6: Make from in rt6_info rcu protected

When a dst entry is created from a fib entry, the 'from' in rt6_info
is set to the fib entry. The 'from' reference is used most notably for
cookie checking - making sure stale dst entries are updated if the
fib entry is changed.

When a fib entry is deleted, the pcpu routes on it are walked releasing
the fib6_info reference. This is needed for the fib6_info cleanup to
happen and to make sure all device references are released in a timely
manner.

There is a race window when a FIB entry is deleted and the 'from' on the
pcpu route is dropped and the pcpu route hits a cookie check. Handle
this race using rcu on from.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip6_fib.h
net/ipv6/ip6_fib.c
net/ipv6/ip6_output.c
net/ipv6/route.c