CVE-2026-98722: mtd: block2mtd: Fix divide error when erase_size is zero

Published Oct 18, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

mtd: block2mtd: Fix divide error when erasesize is zero

The erase size is parsed from the "block2mtd" module parameter and can be set to zero. adddevice() then evaluates

if (size % erasesize)

with a zero divisor, which triggers a divide error:

divide error: 0000 [#1] PREEMPT SMP PTI RIP: 0010:adddevice drivers/mtd/devices/block2mtd.c:296 [inline] RIP: 0010:block2mtdsetup2+0x592/0xda0 drivers/mtd/devices/block2mtd.c:459 Call Trace: block2mtdsetup+0x27/0xe0 drivers/mtd/devices/block2mtd.c:476 paramattrstore+0x214/0x310 kernel/params.c:589 moduleattrstore+0x65/0x90 kernel/params.c:904 kernfsfopwriteiter+0x3a4/0x540 fs/kernfs/file.c:345 ...

Reject a zero erase size before performing the modulo operation so the existing "erasesize must be a divisor of device size" error path reports the invalid argument and frees the device.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Configure the block2mtd module parameter with a non-zero erase size; zero erase sizes trigger a divide error.

    Linux kernel block2mtd erase_size = non-zero

Event History

Oct 18, 2026
CVE Published
via MITRE·03:46 PM
Data Sourced
via MITRE·03:46 PM
Description
Data Sourced
via NVD·04:17 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203