]> git.baikalelectronics.ru Git - kernel.git/commit
mld: respect RCU rules in ip6_mc_source() and ip6_mc_msfilter()
authorEric Dumazet <edumazet@google.com>
Fri, 29 Apr 2022 16:20:36 +0000 (09:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Apr 2022 14:19:08 +0000 (15:19 +0100)
commit25f7d95c352cac9f863963b7643bb24a4f92f106
tree26224d2aba035c4249666eeb6bd9317146976807
parent3d255190434227829daf217404d1bbb16cbf49e3
mld: respect RCU rules in ip6_mc_source() and ip6_mc_msfilter()

Whenever RCU protected list replaces an object,
the pointer to the new object needs to be updated
_before_ the call to kfree_rcu() or call_rcu()

Also ip6_mc_msfilter() needs to update the pointer
before releasing the mc_lock mutex.

Note that linux-5.13 was supporting kfree_rcu(NULL, rcu),
so this fix does not need the conditional test I was
forced to use in the equivalent patch for IPv4.

Fixes: a2790dc6a8a6 ("mld: convert ipv6_mc_socklist->sflist to RCU")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/mcast.c