{"id":"CVE-2026-139006","state":"PUBLISHED","title":"md/raid5: track disks array size to fix extra_page leak on error paths","description":"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->pool_size entries to free extra_page\nallocations, but pool_size may not reflect the actual size of the\nconf->disks 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->disks 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->disks 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->disks.  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.","publishedAt":"2026-11-30T13:27:00.077Z","updatedAt":"2026-11-30T13:27:00.077Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"e88c6ccee75ccb1334df0648843e2bc500ce90d0","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"8e1fa4e1e542ea25cf14e1d7a18b438c51eac6d6","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"006ff293b34060e15ddfa50cbb2778a2446116ab","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"6a5408c6be7c3867221e0c692fc0c4f065c14f38","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"fa1f5f15514c52936e12c77c6f719af6ec51a152","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"e4e9104f9ce463b6876144bae6d1e4484ceb3325","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"a0401d7e0aa3f36501a868ec8b1e6bcfaa7dcd35","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"5028ceee173bfcf844469cfb0d1c151d3f6d0296","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/md/raid5.c","drivers/md/raid5.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.10","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.63","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/md/raid5.c","drivers/md/raid5.h"]}],"references":["https://git.kernel.org/stable/c/e88c6ccee75ccb1334df0648843e2bc500ce90d0","https://git.kernel.org/stable/c/8e1fa4e1e542ea25cf14e1d7a18b438c51eac6d6","https://git.kernel.org/stable/c/006ff293b34060e15ddfa50cbb2778a2446116ab","https://git.kernel.org/stable/c/6a5408c6be7c3867221e0c692fc0c4f065c14f38","https://git.kernel.org/stable/c/fa1f5f15514c52936e12c77c6f719af6ec51a152","https://git.kernel.org/stable/c/e4e9104f9ce463b6876144bae6d1e4484ceb3325","https://git.kernel.org/stable/c/a0401d7e0aa3f36501a868ec8b1e6bcfaa7dcd35","https://git.kernel.org/stable/c/5028ceee173bfcf844469cfb0d1c151d3f6d0296"],"weaknesses":[],"ingestedAt":"2026-11-30T13:40:04.421Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139006.json","commit":"5317bbbde1916a58cb1fadabb726eb126daf44c1","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139006","state":"PUBLISHED","datePublished":"2026-11-30T13:27:00.077Z","dateUpdated":"2026-11-30T13:27:00.077Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.908Z"},"containers":{"cna":{"title":"md/raid5: track disks array size to fix extra_page leak on error paths","descriptions":[{"lang":"en","value":"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->pool_size entries to free extra_page\nallocations, but pool_size may not reflect the actual size of the\nconf->disks 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->disks 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->disks 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->disks.  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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"e88c6ccee75ccb1334df0648843e2bc500ce90d0","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"8e1fa4e1e542ea25cf14e1d7a18b438c51eac6d6","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"006ff293b34060e15ddfa50cbb2778a2446116ab","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"6a5408c6be7c3867221e0c692fc0c4f065c14f38","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"fa1f5f15514c52936e12c77c6f719af6ec51a152","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"e4e9104f9ce463b6876144bae6d1e4484ceb3325","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"a0401d7e0aa3f36501a868ec8b1e6bcfaa7dcd35","versionType":"git"},{"version":"d7bd398e97f236a2353689eca5e8950f67cd34d5","status":"affected","lessThan":"5028ceee173bfcf844469cfb0d1c151d3f6d0296","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/md/raid5.c","drivers/md/raid5.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.10","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.63","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/md/raid5.c","drivers/md/raid5.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/e88c6ccee75ccb1334df0648843e2bc500ce90d0"},{"url":"https://git.kernel.org/stable/c/8e1fa4e1e542ea25cf14e1d7a18b438c51eac6d6"},{"url":"https://git.kernel.org/stable/c/006ff293b34060e15ddfa50cbb2778a2446116ab"},{"url":"https://git.kernel.org/stable/c/6a5408c6be7c3867221e0c692fc0c4f065c14f38"},{"url":"https://git.kernel.org/stable/c/fa1f5f15514c52936e12c77c6f719af6ec51a152"},{"url":"https://git.kernel.org/stable/c/e4e9104f9ce463b6876144bae6d1e4484ceb3325"},{"url":"https://git.kernel.org/stable/c/a0401d7e0aa3f36501a868ec8b1e6bcfaa7dcd35"},{"url":"https://git.kernel.org/stable/c/5028ceee173bfcf844469cfb0d1c151d3f6d0296"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:27:00.077Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"5.10.275"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"6.18.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.10","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}