{"id":"CVE-2026-89557","aliases":["CVE-2026-89557"],"related":[],"kind":"vulnerability","state":"published","title":"md: do overflow check for sb->bblog_shift in super_1_load()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmd: do overflow check for sb->bblog_shift in super_1_load()\n\nIn super_1_load(), sb->bblog_shift is an __u8 type value loaded from on-\ndisk superblock. It is used for badblocks API badblocks_set() by the\nfollowing sequence,\n\n 1930   rdev->badblocks.shift = sb->bblog_shift;\n 1931   for (i = 0 ; i < (sectors << (9-3)) ; i++, bbp++) {\n 1932           u64 bb = le64_to_cpu(*bbp);\n 1933           int count = bb & (0x3ff);\n 1934           u64 sector = bb >> 10;\n 1935           sector <<= sb->bblog_shift;\n 1936           count <<= sb->bblog_shift;\n 1937           if (bb + 1 == 0)\n 1938                   break;\n 1939           if (!badblocks_set(&rdev->badblocks, sector, count, 1))\n 1940                   return -EINVAL;\n 1941   }\n\nbb->bblog_shit is in range of 0-255, variable sector is 64bit width, for\nan invalid bb->bblog_shit, it is possible to make sector be overflowed\nby the following calculation,\n 1935           sector <<= sb->bblog_shift;\nThen in turn when call badblocks_set() at line 1939 with the invalid\nrdev->badblocks.shift set at line 1930, may result an overflow inside\n_badblocks_clear() in block/badblocks.c.\n\nAlthough there are many places to call badblocks APIs, the non-zero\nshift value is only used in super_1_load(), other places always use 0 as\nthe shift value. Therefore it is unnecessary to do a general shift value\noverflow check inside badblock API, and just check here as the caller.\n\nThis may avoid unnecessary check, make the badblocks API code more simple\nand elegant.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmd: do overflow check for sb->bblog_shift in super_1_load()\n\nIn super_1_load(), sb->bblog_shift is an __u8 type value loaded from on-\ndisk superblock. It is used for badblocks API badblocks_set() by the\nfollowing sequence,\n\n 1930   rdev->badblocks.shift = sb->bblog_shift;\n 1931   for (i = 0 ; i < (sectors << (9-3)) ; i++, bbp++) {\n 1932           u64 bb = le64_to_cpu(*bbp);\n 1933           int count = bb & (0x3ff);\n 1934           u64 sector = bb >> 10;\n 1935           sector <<= sb->bblog_shift;\n 1936           count <<= sb->bblog_shift;\n 1937           if (bb + 1 == 0)\n 1938                   break;\n 1939           if (!badblocks_set(&rdev->badblocks, sector, count, 1))\n 1940                   return -EINVAL;\n 1941   }\n\nbb->bblog_shit is in range of 0-255, variable sector is 64bit width, for\nan invalid bb->bblog_shit, it is possible to make sector be overflowed\nby the following calculation,\n 1935           sector <<= sb->bblog_shift;\nThen in turn when call badblocks_set() at line 1939 with the invalid\nrdev->badblocks.shift set at line 1930, may result an overflow inside\n_badblocks_clear() in block/badblocks.c.\n\nAlthough there are many places to call badblocks APIs, the non-zero\nshift value is only used in super_1_load(), other places always use 0 as\nthe shift value. Therefore it is unnecessary to do a general shift value\noverflow check inside badblock API, and just check here as the caller.\n\nThis may avoid unnecessary check, make the badblocks API code more simple\nand elegant.","source":"cvelist"}],"published":"2026-09-11T19:44:29.857Z","modified":"2026-10-19T09:17:51.190Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"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:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"94c820d99a4305d4ded41a97ed37ec7d26c56e7f","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"573fb68105fdc6a127ba6069e58a0d2aff3c9f93","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"323f3a056dbccb39a642ebde642044a680f3a6d6","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"0a03f9541c06fda64301dcf94f376f07ce2cc396","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"75d15738fd33a782606d0dc80cfeff47edf2ddd8","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"3b097416b4cff77285c1f472fc2c4058d8a7554f","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"df7d4d011d5ace20699ea948712f09f9ac08924f","status":"affected"},{"type":"git","introduced":"2699b67223aca6b1450fc2f72e40fada952afc85","fixed":"35d522bd32462afcf1981dab6da8a9256c26c1e0","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.270","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.221","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.188","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.157","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.109","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.50","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.2.4","lastAffected":"7.2.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.3","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/94c820d99a4305d4ded41a97ed37ec7d26c56e7f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/573fb68105fdc6a127ba6069e58a0d2aff3c9f93","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/323f3a056dbccb39a642ebde642044a680f3a6d6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0a03f9541c06fda64301dcf94f376f07ce2cc396","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/75d15738fd33a782606d0dc80cfeff47edf2ddd8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3b097416b4cff77285c1f472fc2c4058d8a7554f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/df7d4d011d5ace20699ea948712f09f9ac08924f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/35d522bd32462afcf1981dab6da8a9256c26c1e0","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-16T19:24:07.440Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-89557","url":"https://www.cve.org/CVERecord?id=CVE-2026-89557","licence":"CVE Terms of Use","modified":"2026-10-19T08:48:50.070Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-89557","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-89557","licence":"Public domain","modified":"2026-10-19T09:17:51.190Z"}],"updatedAt":"2026-11-25T22:59:38.065Z","epss":{"score":0.00169,"percentile":0.06509,"date":"2026-12-01T12:00:22.000Z"}}