{"id":"CVE-2026-139006","summary":"md/raid5: track disks array size to fix extra_page leak on error paths","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmd/raid5: track disks array size to fix extra_page leak on error paths\n\nfree_conf() iterates conf-\u003epool_size entries to free extra_page\nallocations, but pool_size may not reflect the actual size of the\nconf-\u003edisks array.  Two scenarios cause a mismatch:\n\n1. setup_conf() early abort: pool_size is 0 (not yet set by\n   grow_stripes) but conf-\u003edisks has max_disks entries with\n   extra_page allocated.  The loop iterates 0 times, leaking all\n   pages.\n\n2. resize_stripes() Step 4 failure: conf-\u003edisks was replaced with\n   a newsize-entry array in Step 3, but pool_size is only updated\n   on success.  The loop iterates pool_size (old, smaller value)\n   times, leaking (newsize - pool_size) pages.\n\nAdd a dedicated disks_cnt field to track the actual number of\nentries in conf-\u003edisks.  Set it immediately after each allocation\nor replacement (in setup_conf and resize_stripes Step 3, where the\narray is safely stalled with no concurrent access), and use it in\nfree_conf() instead of pool_size.\n\nThis leaves pool_size untouched, preserving the check_reshape()\nretry behavior that depends on pool_size only being updated on\nfull success.","modified":"2026-11-30T15:01:44.970239930Z","published":"2026-11-30T13:27:00.077Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139006.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/006ff293b34060e15ddfa50cbb2778a2446116ab"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5028ceee173bfcf844469cfb0d1c151d3f6d0296"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6a5408c6be7c3867221e0c692fc0c4f065c14f38"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8e1fa4e1e542ea25cf14e1d7a18b438c51eac6d6"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a0401d7e0aa3f36501a868ec8b1e6bcfaa7dcd35"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e4e9104f9ce463b6876144bae6d1e4484ceb3325"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e88c6ccee75ccb1334df0648843e2bc500ce90d0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/fa1f5f15514c52936e12c77c6f719af6ec51a152"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139006.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139006"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"d7bd398e97f236a2353689eca5e8950f67cd34d5"},{"fixed":"e88c6ccee75ccb1334df0648843e2bc500ce90d0"},{"fixed":"8e1fa4e1e542ea25cf14e1d7a18b438c51eac6d6"},{"fixed":"006ff293b34060e15ddfa50cbb2778a2446116ab"},{"fixed":"6a5408c6be7c3867221e0c692fc0c4f065c14f38"},{"fixed":"fa1f5f15514c52936e12c77c6f719af6ec51a152"},{"fixed":"e4e9104f9ce463b6876144bae6d1e4484ceb3325"},{"fixed":"a0401d7e0aa3f36501a868ec8b1e6bcfaa7dcd35"},{"fixed":"5028ceee173bfcf844469cfb0d1c151d3f6d0296"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139006.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.10.0"},{"fixed":"5.10.275"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139006.json"}}],"schema_version":"1.9.2"}