ipv6: mcast: Fix potential UAF in MLD delayed work
- 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 5.10.261, 5.15.212, 6.1.178, 6.6.145, 6.12.97, and 2 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
- Exploitation: none
- Automatable: yes
- Technical impact: total
Summary
In the Linux kernel, the following vulnerability has been resolved: ipv6: mcast: Fix potential UAF in MLD delayed work A race condition exists between device teardown and incoming MLD query processing, leading to a Use-After-Free in the MLD delayed work. During device destruction, the primary reference to inet6_dev is dropped, which can drop its refcount to 0. The actual freeing of inet6_dev memory is deferred via RCU. Concurrently, the packet receive path runs under RCU read lock and obtains the inet6_dev pointer. Because the memory is RCU-protected, CPU-0 can safely dereference inet6_dev even if its refcount has hit 0. However, if CPU-0 calls igmp6_event_query() and schedules delayed work, it attempts to acquire a reference using in6_dev_hold(). This increments the refcount from 0 to 1, triggering a "refcount_t: addition on 0" warning. Since the inet6_dev memory is still scheduled to be freed after the RCU grace period, the device is freed while the work is still scheduled. When the work runs, it accesses the freed memory, causing a kernel panic. Fix this by using refcount_inc_not_zero() (via a new helper in6_dev_hold_safe()) to prevent acquiring a reference if the device is already being destroyed. If the refcount is 0, we do not schedule the work.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: yes · Technical impact: total
- Record last updated
Affected versions
- Linux Linux
From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · fixed in f12b63ef26a035c5a29b3ef56401e38199010d4a; From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · fixed in 0401d6cf7877c9be36652385dfcbf7f891b8b590; From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · fixed in f03b0a45535d49bdab7e502efaacee205b2a7865; From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · fixed in 9815e834f5ff8b39e0ea9f0dbd532f4a3b8f0785; From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · fixed in ebbebf6cee950d7f1c81990256c0eae9e62572ae; From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · fixed in 9ce741c22df4fd9546e30306317ac7df3607e48f; From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · fixed in 0458ba1cda830ba4ccfcd9e19c0891438bcdbe4e; From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · fixed in 9b26518b6896a16b809b1e42986f4ebac7bccc1e
- Linux Linux
2.6.12
- KernelLinux
From 2.6.12 · fixed in 5.10.261; From 5.11.0 · fixed in 5.15.212; From 5.16.0 · fixed in 6.1.178; From 6.2.0 · fixed in 6.6.145; From 6.7.0 · fixed in 6.12.97; From 6.13.0 · fixed in 6.18.40; From 6.19.0 · fixed in 7.1.5
References 8
git.kernel.org
- stable/c/f12b63ef26a035c5a29b3ef56401e38199010d4a
- stable/c/0401d6cf7877c9be36652385dfcbf7f891b8b590
- stable/c/f03b0a45535d49bdab7e502efaacee205b2a7865
- stable/c/9815e834f5ff8b39e0ea9f0dbd532f4a3b8f0785
- stable/c/ebbebf6cee950d7f1c81990256c0eae9e62572ae
- stable/c/9ce741c22df4fd9546e30306317ac7df3607e48f
- stable/c/0458ba1cda830ba4ccfcd9e19c0891438bcdbe4e
- stable/c/9b26518b6896a16b809b1e42986f4ebac7bccc1e