CVE-2026-89953: mtd: mtdoops: free page bitmap when the backing MTD is removed
In the Linux kernel, the following vulnerability has been resolved:
mtd: mtdoops: free page bitmap when the backing MTD is removed
mtdoopsnotifyadd() allocates oopspageused when the configured MTD device is registered. mtdoopsnotifyremove() 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 Software
Event History
Frequently Asked Questions
Which systems are realistically exposed to this leak?
Systems that keep mtdoops loaded while its configured backing MTD device can be removed and later registered again are exposed. The usual configuration with a static MTD device does not exhibit the issue.
What event is required to trigger the problem?
The configured backing MTD device must be removed and then registered again while mtdoops remains loaded. Each remove/add cycle can leak one vmalloc allocation when the add path replaces the retained page-bitmap pointer.
Does this indicate a double-free after a backing-device removal?
The described issue is a memory leak during reattachment. The fix clears the bitmap pointer and page count after removal, which also prevents the module exit path from attempting to free the bitmap again after a remove event.