{"id":"CVE-2026-98722","summary":"mtd: block2mtd: Fix divide error when erase_size is zero","details":"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.","modified":"2026-10-19T02:45:30.753506365Z","published":"2026-10-18T15:46:58.093Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98722.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/21d0f05989bf0d5cef57b467a7fa4feefbd7236a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/826170a49ca1315af6b293a02200585b1e2186d9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a991c28066e7ba4da7450bb04478849f7ac6a14a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b5965c4221165045e19736794ca5f48ae3d67142"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98722.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98722"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"ea6d833a3fddcd1d60414d48f34c7f4fbe88608f"},{"fixed":"826170a49ca1315af6b293a02200585b1e2186d9"},{"fixed":"a991c28066e7ba4da7450bb04478849f7ac6a14a"},{"fixed":"21d0f05989bf0d5cef57b467a7fa4feefbd7236a"},{"fixed":"b5965c4221165045e19736794ca5f48ae3d67142"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-98722.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.15.0"},{"fixed":"6.12.113"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.56"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.2.10"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-98722.json"}}],"schema_version":"1.9.0"}