CVE-2026-138991

Source
https://cve.org/CVERecord?id=CVE-2026-138991
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138991.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-138991
Downstream
Published
2026-11-30T13:26:51Z
Modified
2026-11-30T15:01:43Z
Summary
md: validate bblog_size when loading v1.x badblocks metadata
Details

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.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138991.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
2699b67223aca6b1450fc2f72e40fada952afc85
Fixed
2a0088960aeec328c0afa34df324192594212bf8
Fixed
1b9c1af3039596f2374225a5f6c9962a2a117192
Fixed
ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9
Fixed
e507b6589712e72bb1f5eeac17f4bbfce48eb9a7
Fixed
6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb
Fixed
750960f85f5467d7271b54ddc215e5800b0a08db
Fixed
ed89d13541c89246fd410b2d95861096ad3d43c1
Fixed
ae5f89b23cb88667cfa1273b42d6a551db9c651e

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138991.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.1.0
Fixed
5.10.275
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.226
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.193
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.163
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.117
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.63
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.3.4

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138991.json"