CVE-2026-72322: ipv6: mcast: Fix potential UAF in MLD delayed work
From: Greg Kroah-Hartman <[email protected]>
Description
===========
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.
The Linux kernel CVE team has assigned CVE-2026-72322 to this issue.
Affected and fixed versions
===========================
Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 5.10.261 with commit f12b63ef26a035c5a29b3ef56401e38199010d4a Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 5.15.212 with commit 0401d6cf7877c9be36652385dfcbf7f891b8b590 Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.1.178 with commit f03b0a45535d49bdab7e502efaacee205b2a7865 Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.6.145 with commit 9815e834f5ff8b39e0ea9f0dbd532f4a3b8f0785 Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.12.97 with commit ebbebf6cee950d7f1c81990256c0eae9e62572ae Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 6.18.40 with commit 9ce741c22df4fd9546e30306317ac7df3607e48f Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 7.1.5 with commit 0458ba1cda830ba4ccfcd9e19c0891438bcdbe4e Issue introduced in 2.6.12 with commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and fixed in 7.2-rc3 with commit 9b26518b6896a16b809b1e42986f4ebac7bccc1e
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-72322
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
include/net/addrconf.h
net/ipv6/mcast.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/f12b63ef26a035c5a29b3ef56401e38199010d4a https://git.kernel.org/stable/c/0401d6cf7877c9be36652385dfcbf7f891b8b590 https://git.kernel.org/stable/c/f03b0a45535d49bdab7e502efaacee205b2a7865 https://git.kernel.org/stable/c/9815e834f5ff8b39e0ea9f0dbd532f4a3b8f0785 https://git.kernel.org/stable/c/ebbebf6cee950d7f1c81990256c0eae9e62572ae https://git.kernel.org/stable/c/9ce741c22df4fd9546e30306317ac7df3607e48f https://git.kernel.org/stable/c/0458ba1cda830ba4ccfcd9e19c0891438bcdbe4e https://git.kernel.org/stable/c/9b26518b6896a16b809b1e42986f4ebac7bccc1e