CVE-2024-26631: ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work
In the Linux kernel, the following vulnerability has been resolved:
ipv6: mcast: fix data-race in ipv6mcdown / mldifcwork
idev->mcifccount can be written over without proper locking.
Originally found by syzbot [1], fix this issue by encapsulating calls to mldifcstopwork() (and mldgqstopwork() for good measure) with mutexlock() and mutexunlock() accordingly as these functions should only be called with mclock per their declarations.
[1] BUG: KCSAN: data-race in ipv6mcdown / mldifcwork
write to 0xffff88813a80c832 of 1 bytes by task 3771 on cpu 0: mldifcstopwork net/ipv6/mcast.c:1080 [inline] ipv6mcdown+0x10a/0x280 net/ipv6/mcast.c:2725 addrconfifdown+0xe32/0xf10 net/ipv6/addrconf.c:3949 addrconfnotify+0x310/0x980 notifiercallchain kernel/notifier.c:93 [inline] rawnotifiercallchain+0x6b/0x1c0 kernel/notifier.c:461 devnotifyflags+0x205/0x3d0 devchangeflags+0xab/0xd0 net/core/dev.c:8685 dosetlink+0x9f6/0x2430 net/core/rtnetlink.c:2916 rtnlgroupchangelink net/core/rtnetlink.c:3458 [inline] rtnlnewlink net/core/rtnetlink.c:3717 [inline] rtnlnewlink+0xbb3/0x1670 net/core/rtnetlink.c:3754 rtnetlinkrcvmsg+0x807/0x8c0 net/core/rtnetlink.c:6558 netlinkrcvskb+0x126/0x220 net/netlink/afnetlink.c:2545 rtnetlinkrcv+0x1c/0x20 net/core/rtnetlink.c:6576 netlinkunicastkernel net/netlink/afnetlink.c:1342 [inline] netlinkunicast+0x589/0x650 net/netlink/afnetlink.c:1368 netlinksendmsg+0x66e/0x770 net/netlink/afnetlink.c:1910 ...
write to 0xffff88813a80c832 of 1 bytes by task 22 on cpu 1: mldifcwork+0x54c/0x7b0 net/ipv6/mcast.c:2653 processonework kernel/workqueue.c:2627 [inline] processscheduledworks+0x5b8/0xa30 kernel/workqueue.c:2700 workerthread+0x525/0x730 kernel/workqueue.c:2781 ...
Other sources
In the Linux kernel, the following vulnerability has been resolved:
ipv6: mcast: fix data-race in ipv6mcdown / mldifcwork
The Linux kernel CVE team has assigned CVE-2024-26631 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/20240318100758.2828621-14-lee@kernel.org/T
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.15.148 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.1.75 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.6.14 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.7.2 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.8 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch CVE-2024-26631 - Configuration
Encapsulate calls to mld_ifc_stop_work() (and mld_gq_stop_work() for good measure) with mutex_lock() and mutex_unlock() accordingly so the calls occur with mc_lock as required, fixing the data-race affecting idev->mc_ifc_count in ipv6_mc_down / mld_ifc_work.
Linux kernel (net/ipv6/mcast.c) mld_ifc_stop_work() and mld_gq_stop_work() call context = Wrap calls with mutex_lock() and mutex_unlock() accordingly (functions should only be called with mc_lock per their declarations)
Event History
Frequently Asked Questions
What is the severity of CVE-2024-26631?
CVE-2024-26631 has not been assigned a specific severity rating yet but involves a data race vulnerability in the Linux kernel.
How do I fix CVE-2024-26631?
To fix CVE-2024-26631, update to the patched Linux kernel versions 5.15.148, 6.1.75, 6.6.14, 6.7.2, 6.8, or specific versions from Debian.
Which systems are affected by CVE-2024-26631?
CVE-2024-26631 affects various Linux kernel versions, specifically those from Red Hat and Debian.
Is there a workaround for CVE-2024-26631?
There are currently no documented workarounds for CVE-2024-26631; the recommended approach is to apply the available patches.
How can I verify if my system is vulnerable to CVE-2024-26631?
You can verify if your system is vulnerable to CVE-2024-26631 by checking the kernel version installed and comparing it to the specified vulnerable versions.