Skip to content

ipv6: mcast: RCU and timer fixes

Eric Dumazet netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 5 repliesApplied 5/5
  2. v15 patches 5 repliesSuperseded

Patches in v2 All 5 applied

#Subject and filesSizeRepliesApplied
1/5ipv6: mcast: fix RCU list diversion in ip6_mc_del1_src()net/ipv6/mcast.c+11 -71 replyApplied
2/5ipv6: mcast: use copy-on-write RCU updates in ip6_mc_source()include/net/if_inet6.h net/ipv6/mcast.c+56 -441 replyApplied
3/5ipv6: mcast: fix delay calculation in igmp6_join_group()net/ipv6/mcast.c+6 -21 replyApplied
4/5ipv6: mcast: use rcu_assign_pointer() for __rcu list updatesnet/ipv6/mcast.c+13 -71 replyApplied
5/5ipv6: mcast: use jiffies_delta_to_clock_t() in igmp6_mc_seq_show()net/ipv6/mcast.c+2 -21 replyApplied

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchIdo Schimmel
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 net 0/5] ipv6: mcast: RCU and timer fixes

This series addresses several RCU synchronization and timer calculation issues identified in IPv6 multicast (MLD) handling within net/ipv6/mcast.c while I was working on fixing a syzbot report in net/ipv4/icmp.c.

Patch 1 fixes an RCU reader diversion in ip6_mc_del1_src() where mutating psf->sf_next to insert an unlinked source node into the tombstone list diverted concurrent lockless readers (e.g. ipv6_chk_mcast_addr()) into pmc->mca_tomb, causing them to miss remaining active sources.

Patch 2 converts ip6_mc_source() to use copy-on-write RCU updates. Previously, source additions and deletions modified the socket's psl->sl_addr array in-place, causing concurrent lockless readers in inet6_mc_check() (UDP/RAW receive path) to observe torn 16-byte IPv6 addresses or duplicated/missed sources.

Patch 3 fixes delay calculation in igmp6_join_group() when canceling an existing delayed work, preventing unsigned jiffies underflows when the timer has already expired and clamping the delay to the unsolicited report interval.

Patch 4 ensures rcu_assign_pointer() is consistently used for __rcu list updates in __ipv6_dev_mc_dec(), ipv6_sock_mc_drop(), __ipv6_sock_mc_close(), and related helpers.

Patch 5 switches igmp6_mc_seq_show() to use jiffies_delta_to_clock_t() with a signed long delta, preventing underflows in /proc/net/igmp6 timer duration reporting.

v2: addressed AI review.
v1: https://lore.kernel.org/netdev/[email protected]/

Eric Dumazet (5):
ipv6: mcast: fix RCU list diversion in ip6_mc_del1_src()
ipv6: mcast: use copy-on-write RCU updates in ip6_mc_source()
ipv6: mcast: fix delay calculation in igmp6_join_group()
ipv6: mcast: use rcu_assign_pointer() for __rcu list updates
ipv6: mcast: use jiffies_delta_to_clock_t() in igmp6_mc_seq_show()

 include/net/if_inet6.h |   2 -
 net/ipv6/mcast.c       | 148 ++++++++++++++++++++++++-----------------
 2 files changed, 88 insertions(+), 62 deletions(-)
Signature · 1 line
2.55.0.897.gb25b4bd76c-goog