mtd: mtdoops: free page bitmap when the backing MTD is removed
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ be95745f01677245a061a8f51473ef5ec8ad008e · < d06f91a52af11630c9f7e487f6daf242ac310cb8| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mtd: mtdoops: free page bitmap when the backing MTD is removed
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.
From the CVE record · Linux
The Linux kernel's mtdoops component leaks a bitmap allocation when its backing MTD device is removed and registered again while mtdoops remains loaded. Each remove/add cycle leaks another allocation; the usual static MTD setup is not affected. The input does not specify an attacker, authentication requirements, or user interaction.
Engineers running Linux with mtdoops and a backing MTD device that can be removed and registered again should check their systems; affected versions are not specified.