diff options
| author | Kuniyuki Iwashima <[email protected]> | 2025-07-02 23:01:23 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-07-09 01:32:38 +0000 |
| commit | 1767bb2d47b715a106287a8f963d9ec6cbab4e69 (patch) | |
| tree | 7994f91c153716d3daea9905e3fbd13e3a3efec0 /net/lapb/lapb_timer.c | |
| parent | ipv6: mcast: Use in6_dev_get() in ipv6_dev_mc_dec(). (diff) | |
| download | kernel-1767bb2d47b715a106287a8f963d9ec6cbab4e69.tar.gz kernel-1767bb2d47b715a106287a8f963d9ec6cbab4e69.zip | |
ipv6: mcast: Don't hold RTNL for IPV6_ADD_MEMBERSHIP and MCAST_JOIN_GROUP.
In __ipv6_sock_mc_join(), per-socket mld data is protected by lock_sock(),
and only __dev_get_by_index() requires RTNL.
Let's use dev_get_by_index() and drop RTNL for IPV6_ADD_MEMBERSHIP and
MCAST_JOIN_GROUP.
Note that we must call rt6_lookup() and dev_hold() under RCU.
If rt6_lookup() returns an entry from the exception table, dst_dev_put()
could change rt->dev.dst to loopback concurrently, and the original device
could lose the refcount before dev_hold() and unblock device registration.
dst_dev_put() is called from NETDEV_UNREGISTER and synchronize_net() follows
it, so as long as rt6_lookup() and dev_hold() are called within the same
RCU critical section, the dev is alive.
Even if the race happens, they are synchronised by idev->dead and mcast
addresses are cleaned up.
For the racy access to rt->dst.dev, we use dst_dev().
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions
