# CVE-2026-138991: md: validate bblog_size when loading v1.x badblocks metadata

- Severity: High 7.1 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 6% of CVEs (2026-12-01)
- Published: 2026-11-30T13:26:51.892Z
- Modified: 2026-12-01T06:17:31.977Z
- Assigned by: Linux

## 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 2699b67223aca6b1450fc2f72e40fada952afc85 before 2a0088960aeec328c0afa34df324192594212bf8; from 2699b67223aca6b1450fc2f72e40fada952afc85 before 1b9c1af3039596f2374225a5f6c9962a2a117192; from 2699b67223aca6b1450fc2f72e40fada952afc85 before ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9; from 2699b67223aca6b1450fc2f72e40fada952afc85 before e507b6589712e72bb1f5eeac17f4bbfce48eb9a7; from 2699b67223aca6b1450fc2f72e40fada952afc85 before 6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb; from 2699b67223aca6b1450fc2f72e40fada952afc85 before 750960f85f5467d7271b54ddc215e5800b0a08db; from 2699b67223aca6b1450fc2f72e40fada952afc85 before ed89d13541c89246fd410b2d95861096ad3d43c1; from 2699b67223aca6b1450fc2f72e40fada952afc85 before ae5f89b23cb88667cfa1273b42d6a551db9c651e; 3.1 (not affected: before 3.1; from 5.10.275 up to 5.10.*; from 5.15.226 up to 5.15.*; from 6.1.193 up to 6.1.*; from 6.6.163 up to 6.6.*; from 6.12.117 up to 6.12.*; from 6.18.63 up to 6.18.*; from 7.3.4 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/2a0088960aeec328c0afa34df324192594212bf8>
- <https://git.kernel.org/stable/c/1b9c1af3039596f2374225a5f6c9962a2a117192>
- <https://git.kernel.org/stable/c/ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9>
- <https://git.kernel.org/stable/c/e507b6589712e72bb1f5eeac17f4bbfce48eb9a7>
- <https://git.kernel.org/stable/c/6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb>
- <https://git.kernel.org/stable/c/750960f85f5467d7271b54ddc215e5800b0a08db>
- <https://git.kernel.org/stable/c/ed89d13541c89246fd410b2d95861096ad3d43c1>
- <https://git.kernel.org/stable/c/ae5f89b23cb88667cfa1273b42d6a551db9c651e>

## Sources

- CVE List: [CVE-2026-138991](https://www.cve.org/CVERecord?id=CVE-2026-138991), CVE Terms of Use, modified 2026-12-01
- NVD: [CVE-2026-138991](https://nvd.nist.gov/vuln/detail/CVE-2026-138991), Public domain, modified 2026-12-01

---

Page: https://cve.day/CVE-2026-138991 · Whole record: https://cve.day/CVE-2026-138991.json · Rebuilt by cve.day 2026-12-01T06:32:17.179Z
