diff options
author | 2025-04-17 17:03:55 -0700 | |
---|---|---|
committer | 2025-04-24 09:29:56 +0200 | |
commit | 081efd18326e353c6fbfdeff903a83edde953f72 (patch) | |
tree | 74d7075c9a99e46440287c00065150814e2c6704 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | ipv6: Defer fib6_purge_rt() in fib6_add_rt2node() to fib6_add(). (diff) | |
download | wireguard-linux-081efd18326e353c6fbfdeff903a83edde953f72.tar.xz wireguard-linux-081efd18326e353c6fbfdeff903a83edde953f72.zip |
ipv6: Protect nh->f6i_list with spinlock and flag.
We will get rid of RTNL from RTM_NEWROUTE and SIOCADDRT.
Then, we may be going to add a route tied to a dying nexthop.
The nexthop itself is not freed during the RCU grace period, but
if we link a route after __remove_nexthop_fib() is called for the
nexthop, the route will be leaked.
To avoid the race between IPv6 route addition under RCU vs nexthop
deletion under RTNL, let's add a dead flag and protect it and
nh->f6i_list with a spinlock.
__remove_nexthop_fib() acquires the nexthop's spinlock and sets false
to nh->dead, then calls ip6_del_rt() for the linked route one by one
without the spinlock because fib6_purge_rt() acquires it later.
While adding an IPv6 route, fib6_add() acquires the nexthop lock and
checks the dead flag just before inserting the route.
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250418000443.43734-15-kuniyu@amazon.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions