igmp: convert struct ip_sf_list to RCU
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 4.5, 4.10, 4.15, 4.20, 5.5, and 7 more
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
In the Linux kernel, the following vulnerability has been resolved: igmp: convert struct ip_sf_list to RCU Commit 23d2b94043ca ("igmp: Add ip_mc_list lock in ip_check_mc_rcu") added spin_lock_bh(&im->lock) to ip_check_mc_rcu() to prevent a use-after-free while iterating im->sources during concurrent deletions. However, ip_check_mc_rcu() is called from RCU read-side critical sections in packet receive and route lookup fast paths (e.g. __mkroute_output(), ip_route_input_rcu(), and __udp4_lib_rcv()). When igmpv3_send_cr() or igmpv3_send_report() holds &pmc->lock and calls add_grec() -> igmpv3_newpack() -> ip_route_output_ports(), an XFRM policy matching a multicast destination triggers xfrm_tmpl_resolve_one() -> xfrm4_get_saddr() -> __mkroute_output() -> ip_check_mc_rcu(). This attempts to acquire &im->lock while &pmc->lock is already held on the same CPU, triggering a lockdep recursive locking warning / deadlock. Fix this by converting IPv4 struct ip_sf_list to RCU, mirroring the IPv6 implementation in net/ipv6/mcast.c: 1. Add struct rcu_head to struct ip_sf_list and annotate sf_next, sources, and tomb as __rcu pointers. 2. Use rcu_assign_pointer() and kfree_rcu() for list updates and deletions. 3. Remove spin_lock_bh(&im->lock) from ip_check_mc_rcu() and traverse im->sources locklessly with for_each_psf_rcu(), reading and writing counter fields with READ_ONCE() and WRITE_ONCE(). Note: RCU conversion of /proc/net/mcfilter will be done in a separate patch.
Timeline
- CVE published
- Record last updated
Affected versions
- Linux Linux
From 23d2b94043ca8835bd1e67749020e839f396a1c2 · fixed in 01131daffc4b64f1652e23dc3e6e2f601eda781d; From 23d2b94043ca8835bd1e67749020e839f396a1c2 · fixed in f5182dfad54277267a8cb0c004a9cd4cf35aeebb; From 23d2b94043ca8835bd1e67749020e839f396a1c2 · fixed in d3011d1f293478c730aa0870490afa145c37600e; From 23d2b94043ca8835bd1e67749020e839f396a1c2 · fixed in e3206419bdb04e2087d8cc6be324df8639b3fac5; From 23d2b94043ca8835bd1e67749020e839f396a1c2 · fixed in 2987ee196c88dbde0463dc87d5fb209c684e34a2; From 4.4.284 · fixed in 4.5; From 4.9.283 · fixed in 4.10; From 4.14.247 · fixed in 4.15; From 4.19.207 · fixed in 4.20; From 5.4.145 · fixed in 5.5; From 5.10.64 · fixed in 5.11; From 5.13.16 · fixed in 5.14; From 5.14.3 · fixed in 5.15
- Linux Linux
5.15
- KernelLinux
From 5.15.0 · fixed in 6.6.160; From 6.7.0 · fixed in 6.12.111; From 6.13.0 · fixed in 6.18.53; From 6.19.0 · fixed in 7.2.7