{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-138991","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-11-30T13:22:15.907Z","datePublished":"2026-11-30T13:26:51.892Z","dateUpdated":"2026-12-01T05:40:49.717Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-01T05:40:49.717Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmd: validate bblog_size when loading v1.x badblocks metadata\n\nIn super_1_load(), when the on-disk feature_map does not have\nMD_FEATURE_BAD_BLOCKS set but sb->bblog_offset is non-zero,\nrdev->badblocks.shift is initialized to 0 without validating\nsb->bblog_size.  The same field is validated in the\nMD_FEATURE_BAD_BLOCKS branch (\"sectors > (PAGE_SIZE / 512)\"), but this\nbranch bypasses that check.\n\nA forged on-disk superblock (malicious storage device or crafted\nimage) can therefore carry an oversized sb->bblog_size.  When bad\nblocks are later recorded, super_1_sync() sets bb->size from\nsb->bblog_size and md_write_metadata() issues a bio larger than the\nsingle rdev->bb_page, reading beyond the page and leaking kernel\nmemory contents to disk.\n\nsb->bblog_size is never modified by the kernel between load and sync,\nand the MD_FEATURE_BAD_BLOCKS branch already validates it, so checking\nit in this branch is sufficient to cover both paths.\n\nFix this by rejecting an oversized sb->bblog_size with -EINVAL,\nmatching the existing check in the MD_FEATURE_BAD_BLOCKS branch."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","baseScore":7.1,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The oversized sb->bblog_size comes from an MD v1.x superblock that super_1_load() reads off a local member block device (a udisks loop partition or an attached disk). super_1_sync() and md_update_sb() later pass it to md_write_metadata(). No network protocol message carries the value.\nAC:L - The attacker does every step: write a valid-checksum sb with bblog_offset!=0, no MD_FEATURE_BAD_BLOCKS and bblog_size up to 65535; add a spare-role member so mdadm -I's ADD_NEW_DISK flips read-auto to RDWR; return EIO from their FUSE backing file so raid1 handle_sync_write_finished() calls rdev_set_badblocks(). The oversized metadata write then follows deterministically.\nPR:L - md ioctls need init capable(CAP_SYS_ADMIN) in md_ioctl_valid(). But an active-session user can attach their own file via udisks LoopSetup (polkit allow_active=yes, partscan on), and 64-md-raid-assembly.rules then runs mdadm --incremental as root on the partition add events, so an ordinary local login is enough.\nUI:N - No victim action is involved: the attacker's own LoopSetup call produces the uevents, and udev/mdadm assemble the foreign array automatically. The attacker also drives the spare add and the I/O errors that record the bad block.\nS:U - The disclosed memory and any resulting fault stay within the host kernel's own authority; no VM, IOMMU or sandbox boundary is crossed.\nC:H - md_update_sb() calls md_write_metadata(..., rdev->badblocks.size << 9, rdev->bb_page, 0), so one order-0 alloc_page() page becomes a bvec of up to 33553920 bytes. lo_rw_aio's bvec iov_iter then copies ~32MB of the physically following kernel memory (page cache, slab, other processes' pages) into the attacker's FUSE backing file.\nI:N - No kernel memory is written. The oversized bio goes to sb_start + bblog_offset on the attacker's own member partition, and bio_check_eod() keeps it inside that partition, so only attacker-owned on-disk data is overwritten.\nA:H - The ~32MB copy reads each page past bb_page through the direct map. If the window crosses a page removed from it (e.g. memfd_secret pages, which unprivileged users can create, or the end of a RAM range), the copy faults and the kernel oopses in the loop worker."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/md/md.c"],"versions":[{"version":"2699b67223aca6b1450fc2f72e40fada952afc85","lessThan":"2a0088960aeec328c0afa34df324192594212bf8","status":"affected","versionType":"git"},{"version":"2699b67223aca6b1450fc2f72e40fada952afc85","lessThan":"1b9c1af3039596f2374225a5f6c9962a2a117192","status":"affected","versionType":"git"},{"version":"2699b67223aca6b1450fc2f72e40fada952afc85","lessThan":"ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9","status":"affected","versionType":"git"},{"version":"2699b67223aca6b1450fc2f72e40fada952afc85","lessThan":"e507b6589712e72bb1f5eeac17f4bbfce48eb9a7","status":"affected","versionType":"git"},{"version":"2699b67223aca6b1450fc2f72e40fada952afc85","lessThan":"6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb","status":"affected","versionType":"git"},{"version":"2699b67223aca6b1450fc2f72e40fada952afc85","lessThan":"750960f85f5467d7271b54ddc215e5800b0a08db","status":"affected","versionType":"git"},{"version":"2699b67223aca6b1450fc2f72e40fada952afc85","lessThan":"ed89d13541c89246fd410b2d95861096ad3d43c1","status":"affected","versionType":"git"},{"version":"2699b67223aca6b1450fc2f72e40fada952afc85","lessThan":"ae5f89b23cb88667cfa1273b42d6a551db9c651e","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/md/md.c"],"versions":[{"version":"3.1","status":"affected"},{"version":"0","lessThan":"3.1","status":"unaffected","versionType":"semver"},{"version":"5.10.275","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.226","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.193","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.163","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.117","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.63","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.4","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.1","versionEndExcluding":"5.10.275"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.1","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.1","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.1","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.1","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.1","versionEndExcluding":"6.18.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.1","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.1","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/2a0088960aeec328c0afa34df324192594212bf8"},{"url":"https://git.kernel.org/stable/c/1b9c1af3039596f2374225a5f6c9962a2a117192"},{"url":"https://git.kernel.org/stable/c/ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9"},{"url":"https://git.kernel.org/stable/c/e507b6589712e72bb1f5eeac17f4bbfce48eb9a7"},{"url":"https://git.kernel.org/stable/c/6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb"},{"url":"https://git.kernel.org/stable/c/750960f85f5467d7271b54ddc215e5800b0a08db"},{"url":"https://git.kernel.org/stable/c/ed89d13541c89246fd410b2d95861096ad3d43c1"},{"url":"https://git.kernel.org/stable/c/ae5f89b23cb88667cfa1273b42d6a551db9c651e"}],"title":"md: validate bblog_size when loading v1.x badblocks metadata","x_generator":{"engine":"bippy-1.2.0"}}}}