{"id":"CVE-2026-138991","aliases":["CVE-2026-138991"],"related":[],"kind":"vulnerability","state":"published","title":"md: validate bblog_size when loading v1.x badblocks metadata","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"}],"published":"2026-11-30T13:26:51.892Z","modified":"2026-12-01T06:17:31.977Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"2a0088960aeec328c0afa34df324192594212bf8","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"1b9c1af3039596f2374225a5f6c9962a2a117192","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"e507b6589712e72bb1f5eeac17f4bbfce48eb9a7","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"750960f85f5467d7271b54ddc215e5800b0a08db","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"ed89d13541c89246fd410b2d95861096ad3d43c1","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"ae5f89b23cb88667cfa1273b42d6a551db9c651e","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.1","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.1","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/2a0088960aeec328c0afa34df324192594212bf8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1b9c1af3039596f2374225a5f6c9962a2a117192","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ed3334dc84bdb5d5062955c4aece6b5bfb6a68c9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e507b6589712e72bb1f5eeac17f4bbfce48eb9a7","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6161721e0cc7cc45be5d4b2edfbec7d3f211bfeb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/750960f85f5467d7271b54ddc215e5800b0a08db","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ed89d13541c89246fd410b2d95861096ad3d43c1","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ae5f89b23cb88667cfa1273b42d6a551db9c651e","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138991","url":"https://www.cve.org/CVERecord?id=CVE-2026-138991","licence":"CVE Terms of Use","modified":"2026-12-01T05:40:49.717Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138991","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138991","licence":"Public domain","modified":"2026-12-01T06:17:31.977Z"}],"updatedAt":"2026-12-01T06:32:17.179Z","epss":{"score":0.00167,"percentile":0.06282,"date":"2026-12-01T12:00:22.000Z"}}