diff options
author | Eric Dumazet <edumazet@google.com> | 2022-06-23 06:34:41 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-06-24 12:34:37 +0200 |
commit | 6d08658736fc8b4baae778a7f51d2c7baa47eeff (patch) | |
tree | 4a15ba6eab62dfaab505b18d74188304ca0a6df2 /net/ipv6/ip6mr.c | |
parent | ip6mr: ip6mr_cache_report() changes (diff) | |
download | linux-6d08658736fc8b4baae778a7f51d2c7baa47eeff.tar.xz linux-6d08658736fc8b4baae778a7f51d2c7baa47eeff.zip |
ip6mr: do not acquire mrt_lock in pim6_rcv()
rcu_read_lock() protection is more than enough.
vif_dev_read() supports either mrt_lock or rcu_read_lock().
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6mr.c')
-rw-r--r-- | net/ipv6/ip6mr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index a6d97952bf53..fa6720377e82 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -559,12 +559,11 @@ static int pim6_rcv(struct sk_buff *skb) if (ip6mr_fib_lookup(net, &fl6, &mrt) < 0) goto drop; - reg_vif_num = mrt->mroute_reg_vif_num; - read_lock(&mrt_lock); + /* Pairs with WRITE_ONCE() in mif6_add()/mif6_delete() */ + reg_vif_num = READ_ONCE(mrt->mroute_reg_vif_num); if (reg_vif_num >= 0) reg_dev = vif_dev_read(&mrt->vif_table[reg_vif_num]); - read_unlock(&mrt_lock); if (!reg_dev) goto drop; |