CVE-2026-138991
published high CVSS 3.1 · 7.1md: validate bblog_size when loading v1.x badblocks metadata
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux2699b67223aca6b1450fc2f72e40fada952afc85 to < 2a0088960aeec328c0afa34df324192594212bf8 · 2699b67223aca6b1450fc2f72e40fada952afc85 to < 1b9c1af3039596f2374225a5f6c9962a2a117192 · 2699b67223aca6b1450fc2f72e40fada952afc85 to < ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9 · 2699b67223aca6b1450fc2f72e40fada952afc85 to < e507b6589712e72bb1f5eeac17f4bbfce48eb9a7 · 2699b67223aca6b1450fc2f72e40fada952afc85 to < 6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb · 2699b67223aca6b1450fc2f72e40fada952afc85 to < 750960f85f5467d7271b54ddc215e5800b0a08db · 2699b67223aca6b1450fc2f72e40fada952afc85 to < ed89d13541c89246fd410b2d95861096ad3d43c1 · 2699b67223aca6b1450fc2f72e40fada952afc85 to < ae5f89b23cb88667cfa1273b42d6a551db9c651e · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux3.1 (affected) · 0 to < 3.1 (unaffected · semver) · 5.10.275 through 5.10.* (unaffected · semver) · 5.15.226 through 5.15.* (unaffected · semver) · 6.1.193 through 6.1.* (unaffected · semver) · 6.6.163 through 6.6.* (unaffected · semver) · 6.12.117 through 6.12.* (unaffected · semver) · 6.18.63 through 6.18.* (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Pending Fix | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Pending Fix | Not stated | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: md: validate bblog_size when loading v1.x badblocks metadata In super_1_load(), when the on-disk feature_map does not have MD_FEATURE_BAD_BLOCKS set but sb->bblog_offset is non-zero, rdev->badblocks.shift is initialized to 0 without validating sb->bblog_size. The same field is validated in the MD_FEATURE_BAD_BLOCKS branch ("sectors > (PAGE_SIZE / 512)"), but this branch bypasses that check. A forged on-disk superblock (malicious storage device or crafted image) can therefore carry an oversized sb->bblog_size. When bad blocks are later recorded, super_1_sync() sets bb->size from sb->bblog_size and md_write_metadata() issues a bio larger than the single rdev->bb_page, reading beyond the page and leaking kernel memory contents to disk. sb->bblog_size is never modified by the kernel between load and sync, and the MD_FEATURE_BAD_BLOCKS branch already validates it, so checking it in this branch is sufficient to cover both paths. Fix this by rejecting an oversized sb->bblog_size with -EINVAL, matching the existing check in the MD_FEATURE_BAD_BLOCKS branch.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.1 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
- Scenarios
- en: 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. AC: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. PR: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. UI: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. S:U - The disclosed memory and any resulting fault stay within the host kernel's own authority; no VM, IOMMU or sandbox boundary is crossed. C: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. I: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. A: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.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 2699b67223aca6b1450fc2f72e40fada952afc85 to < 2a0088960aeec328c0afa34df324192594212bf8 (affected · git)2699b67223aca6b1450fc2f72e40fada952afc85 to < 1b9c1af3039596f2374225a5f6c9962a2a117192 (affected · git)2699b67223aca6b1450fc2f72e40fada952afc85 to < ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9 (affected · git)2699b67223aca6b1450fc2f72e40fada952afc85 to < e507b6589712e72bb1f5eeac17f4bbfce48eb9a7 (affected · git)2699b67223aca6b1450fc2f72e40fada952afc85 to < 6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb (affected · git)2699b67223aca6b1450fc2f72e40fada952afc85 to < 750960f85f5467d7271b54ddc215e5800b0a08db (affected · git)2699b67223aca6b1450fc2f72e40fada952afc85 to < ed89d13541c89246fd410b2d95861096ad3d43c1 (affected · git)2699b67223aca6b1450fc2f72e40fada952afc85 to < ae5f89b23cb88667cfa1273b42d6a551db9c651e (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 3.1 (affected)0 to < 3.1 (unaffected · semver)5.10.275 through 5.10.* (unaffected · semver)5.15.226 through 5.15.* (unaffected · semver)6.1.193 through 6.1.* (unaffected · semver)6.6.163 through 6.6.* (unaffected · semver)6.12.117 through 6.12.* (unaffected · semver)6.18.63 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
8- https://git.kernel.org/stable/c/1b9c1af3039596f2374225a5f6c9962a2a117192
- https://git.kernel.org/stable/c/2a0088960aeec328c0afa34df324192594212bf8
- https://git.kernel.org/stable/c/6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb
- https://git.kernel.org/stable/c/750960f85f5467d7271b54ddc215e5800b0a08db
- https://git.kernel.org/stable/c/ae5f89b23cb88667cfa1273b42d6a551db9c651e
- https://git.kernel.org/stable/c/e507b6589712e72bb1f5eeac17f4bbfce48eb9a7
- https://git.kernel.org/stable/c/ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9
- https://git.kernel.org/stable/c/ed89d13541c89246fd410b2d95861096ad3d43c1
Provider assertions
1Linux · cna
md: validate bblog_size when loading v1.x badblocks metadata
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- fbba72effcb3f57cf8d1c11dceba8aba77c4886048a4ee8d38d30d2108d909eb
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record