Back

mtd: mtdoops: free page bitmap when the backing MTD is removed

Published Sep 16, 2026

Description

mtdoops_notify_add() allocates oops_page_used when the configured MTD device is registered. mtdoops_notify_remove() detaches from that device but leaves the bitmap allocated. If the same MTD device is later registered again, the add path allocates a new bitmap and overwrites the old pointer, leaking one vmalloc allocation per remove/add cycle.

This is only visible when the backing MTD device can disappear and be registered again while mtdoops remains loaded, so the usual static MTD case does not expose it.

Free the bitmap after unregistering the dumper and flushing the pending workers, then clear the pointer and page count before a later attach can allocate fresh state. Clearing the pointer also keeps the module exit path from freeing the same bitmap a second time after a remove event.

Affected products

Remediation

No remediation recorded yet.

Weaknesses (0)

No CWE recorded.

References (9)

Change history (0)

No recorded changes yet.

Sources

CVE.org / MITRE

Status PUBLISHED
Assigner Linux
Published Sep 16, 2026
Updated Sep 16, 2026
Reserved Sep 11, 2026

CISA Vulnrichment

No data

NVD

Status Received
Modified Sep 16, 2026

Red Hat

No data

ENISA EUVD

Assigner Linux
Published Sep 16, 2026
Updated Sep 16, 2026

GitHub

No data