CVE-2026-138991

md: validate bblog_size when loading v1.x badblocks metadata

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The bug arises in the Linux kernel’s MD superblock handling logic. When a badblocks metadata set (v1.x) is loaded, the kernel fails to validate the sb->bblog_size field if the feature flag MD_FEATURE_BAD_BLOCKS is not present but the offset is non‑zero. A forged superblock can therefore contain an oversized bblog_size, which later causes the kernel to write a bio larger than the allocated page buffer. This overrun leads to kernel memory being written out to disk, exposing sensitive kernel data. The vulnerability is a classic out‑of‑bounds write that results in information disclosure.

Affected Systems

The flaw resides in the Linux kernel’s MD subsystem; affected releases are not enumerated in the advisory. All Linux distributions that ship a vulnerable kernel build, irrespective of vendor, are potentially impacted unless the specific check for sb->bblog_size has been applied.

Risk and Exploitability

EPSS data is unavailable and the vulnerability is not in the CISA KEV list; the CVSS rating is not disclosed. Exploitation would require an attacker to supply a maliciously crafted superblock—either via a tampered storage device or a crafted image—so the attack vector is likely local or device‑level. The scenario also opens a pathway for persistent kernel memory leakage to disk, which could be leveraged for further privilege escalation or forensic compromise. The absence of publicly known exploits and lack of a recognized CVSS score suggests moderate risk pending patch deployment.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Linux kernel to a release that includes the sb->bblog_size validation check
  • Ensure that any MD superblock data is sourced from trusted or signed images; avoid using unverified storage devices
  • If a kernel update is not yet available, disable or avoid using the badblocks v1.x metadata feature on vulnerable devices

Generated by OpenCVE AI on November 30, 2026 at 18:41 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-125
CWE-200
Type Values Removed Values Added
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.
Title md: validate bblog_size when loading v1.x badblocks metadata
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-125

    Out-of-bounds Read

  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:26 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM