CVE-2026-139006: md/raid5: track disks array size to fix extra_page leak on error paths
In the Linux kernel, the following vulnerability has been resolved:
md/raid5: track disks array size to fix extrapage leak on error paths
freeconf() iterates conf->poolsize entries to free extrapage allocations, but poolsize may not reflect the actual size of the conf->disks array. Two scenarios cause a mismatch:
1. setupconf() early abort: poolsize is 0 (not yet set by growstripes) but conf->disks has maxdisks entries with extrapage allocated. The loop iterates 0 times, leaking all pages.
2. resizestripes() Step 4 failure: conf->disks was replaced with a newsize-entry array in Step 3, but poolsize is only updated on success. The loop iterates poolsize (old, smaller value) times, leaking (newsize - poolsize) pages.
Add a dedicated diskscnt field to track the actual number of entries in conf->disks. Set it immediately after each allocation or replacement (in setupconf and resizestripes Step 3, where the array is safely stalled with no concurrent access), and use it in freeconf() instead of poolsize.
This leaves poolsize untouched, preserving the checkreshape() retry behavior that depends on poolsize only being updated on full success.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1Fixed in 7.3.4-1 - Compensating control
In Linux kernel md/raid5, add a dedicated disks_cnt field for the actual conf->disks array size, set it immediately after each allocation, and use it in free_conf() instead of pool_size.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Linux kernel systems using md/raid5 are relevant when RAID5 setup or stripe resizing encounters an error path. The described leak depends on a mismatch between the allocated disks array size and pool_size.
When can the page leak occur?
It can occur when setup_conf() aborts before pool_size is set, or when resize_stripes() fails at Step 4 after replacing conf->disks with a larger array. In both cases, free_conf() may free fewer extra_page allocations than were created.
What does the fix change during cleanup?
The fix adds a disks_cnt field that records the actual number of conf->disks entries immediately after allocation or replacement. free_conf() uses this count for cleanup while leaving pool_size behavior unchanged for reshape retry handling.