CVE-2026-46161: md/raid10: fix divide-by-zero in setup_geo() with zero far_copies
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
md/raid10: fix divide-by-zero in setup_geo() with zero far_copies
setup_geo() extracts near_copies (nc) and far_copies (fc) from the user-provided layout parameter without checking for zero. When fc=0 with the "improved" far set layout selected, 'geo->far_set_size = disks / fc' triggers a divide-by-zero.
Validate nc and fc immediately after extraction, returning -1 if either is zero.
The Linux kernel CVE team has assigned CVE-2026-46161 to this issue.
Affected and fixed versions
===========================
Issue introduced in 3.9 with commit 475901aff15841fb0a81e7546517407779a9b061 and fixed in 6.6.140 with commit 4af2e558e6fdfb972c61350653fd55d1f62b60a5 Issue introduced in 3.9 with commit 475901aff15841fb0a81e7546517407779a9b061 and fixed in 6.12.88 with commit 9d8e03b9a2b1e8ce5c198bf3a409a629f4d02cda Issue introduced in 3.9 with commit 475901aff15841fb0a81e7546517407779a9b061 and fixed in 6.18.30 with commit 913d556e4bd1b56ed822815655b82c7bb54edc51 Issue introduced in 3.9 with commit 475901aff15841fb0a81e7546517407779a9b061 and fixed in 7.0.7 with commit f9ddb621b2325eb69c95692958daf2bab4dea2c4 Issue introduced in 3.9 with commit 475901aff15841fb0a81e7546517407779a9b061 and fixed in 7.1-rc2 with commit 9aa6d860b0930e2f72795665c42c44252a558a0c
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-46161
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:
drivers/md/raid10.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/4af2e558e6fdfb972c61350653fd55d1f62b60a5 https://git.kernel.org/stable/c/9d8e03b9a2b1e8ce5c198bf3a409a629f4d02cda https://git.kernel.org/stable/c/913d556e4bd1b56ed822815655b82c7bb54edc51 https://git.kernel.org/stable/c/f9ddb621b2325eb69c95692958daf2bab4dea2c4 https://git.kernel.org/stable/c/9aa6d860b0930e2f72795665c42c44252a558a0c