{"id":"CVE-2026-98722","aliases":["CVE-2026-98722"],"related":[],"kind":"vulnerability","state":"published","title":"mtd: block2mtd: Fix divide error when erase_size is zero","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmtd: block2mtd: Fix divide error when erase_size is zero\n\nThe erase size is parsed from the \"block2mtd\" module parameter and can\nbe set to zero. add_device() then evaluates\n\n        if (size % erase_size)\n\nwith a zero divisor, which triggers a divide error:\n\ndivide error: 0000 [#1] PREEMPT SMP PTI\nRIP: 0010:add_device drivers/mtd/devices/block2mtd.c:296 [inline]\nRIP: 0010:block2mtd_setup2+0x592/0xda0 drivers/mtd/devices/block2mtd.c:459\nCall Trace:\nblock2mtd_setup+0x27/0xe0 drivers/mtd/devices/block2mtd.c:476\nparam_attr_store+0x214/0x310 kernel/params.c:589\nmodule_attr_store+0x65/0x90 kernel/params.c:904\nkernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345\n...\n\nReject a zero erase size before performing the modulo operation so the\nexisting \"erasesize must be a divisor of device size\" error path\nreports the invalid argument and frees the device.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmtd: block2mtd: Fix divide error when erase_size is zero\n\nThe erase size is parsed from the \"block2mtd\" module parameter and can\nbe set to zero. add_device() then evaluates\n\n        if (size % erase_size)\n\nwith a zero divisor, which triggers a divide error:\n\ndivide error: 0000 [#1] PREEMPT SMP PTI\nRIP: 0010:add_device drivers/mtd/devices/block2mtd.c:296 [inline]\nRIP: 0010:block2mtd_setup2+0x592/0xda0 drivers/mtd/devices/block2mtd.c:459\nCall Trace:\nblock2mtd_setup+0x27/0xe0 drivers/mtd/devices/block2mtd.c:476\nparam_attr_store+0x214/0x310 kernel/params.c:589\nmodule_attr_store+0x65/0x90 kernel/params.c:904\nkernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345\n...\n\nReject a zero erase size before performing the modulo operation so the\nexisting \"erasesize must be a divisor of device size\" error path\nreports the invalid argument and frees the device.","source":"cvelist"}],"published":"2026-10-18T15:46:58.093Z","modified":"2026-10-30T13:21:21.127Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f","fixed":"c8004de07739fa9a39e310e859384f1458d7d076","status":"affected"},{"type":"git","introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f","fixed":"7ad5287e58d7aa1a848105f119e6c5b00446882f","status":"affected"},{"type":"git","introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f","fixed":"fd73c079abc58e10183a4db4dc9dc5012db17476","status":"affected"},{"type":"git","introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f","fixed":"bff83b723e93acc788bd690dc4bc1f6f4356c35b","status":"affected"},{"type":"git","introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f","fixed":"826170a49ca1315af6b293a02200585b1e2186d9","status":"affected"},{"type":"git","introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f","fixed":"a991c28066e7ba4da7450bb04478849f7ac6a14a","status":"affected"},{"type":"git","introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f","fixed":"21d0f05989bf0d5cef57b467a7fa4feefbd7236a","status":"affected"},{"type":"git","introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f","fixed":"b5965c4221165045e19736794ca5f48ae3d67142","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.15","status":"unaffected"},{"type":"semver","introduced":"5.10.273","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.224","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.160","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.113","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.56","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.2.10","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/c8004de07739fa9a39e310e859384f1458d7d076","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7ad5287e58d7aa1a848105f119e6c5b00446882f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fd73c079abc58e10183a4db4dc9dc5012db17476","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bff83b723e93acc788bd690dc4bc1f6f4356c35b","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/826170a49ca1315af6b293a02200585b1e2186d9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a991c28066e7ba4da7450bb04478849f7ac6a14a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/21d0f05989bf0d5cef57b467a7fa4feefbd7236a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b5965c4221165045e19736794ca5f48ae3d67142","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-98722","url":"https://www.cve.org/CVERecord?id=CVE-2026-98722","licence":"CVE Terms of Use","modified":"2026-10-30T12:39:05.611Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-98722","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98722","licence":"Public domain","modified":"2026-10-30T13:21:21.127Z"}],"updatedAt":"2026-11-25T22:59:45.281Z","epss":{"score":0.00177,"percentile":0.07521,"date":"2026-12-01T12:00:22.000Z"}}