CVE-2026-89953: mtd: mtdoops: free page bitmap when the backing MTD is removed
From: Greg Kroah-Hartman <[email protected]>
Description
===========
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.
The Linux kernel CVE team has assigned CVE-2026-89953 to this issue.
Affected and fixed versions
===========================
Issue introduced in 2.6.33 with commit be95745f01677245a061a8f51473ef5ec8ad008e and fixed in 5.10.270 with commit 477d61d54e097e90f748aa18d013805abd56bcbd Issue introduced in 2.6.33 with commit be95745f01677245a061a8f51473ef5ec8ad008e and fixed in 5.15.221 with commit a91ac71e67c3e01ed9afd9841435bebb930293f8 Issue introduced in 2.6.33 with commit be95745f01677245a061a8f51473ef5ec8ad008e and fixed in 6.1.188 with commit 698944132083d143ef965c0090ee14ba1d9e1a5f Issue introduced in 2.6.33 with commit be95745f01677245a061a8f51473ef5ec8ad008e and fixed in 6.6.157 with commit f25c804947e0a28c15e73da8e2e0db959cbed716 Issue introduced in 2.6.33 with commit be95745f01677245a061a8f51473ef5ec8ad008e and fixed in 6.12.110 with commit 8414f0e9f707226de20b48c7048179fd86d352fc Issue introduced in 2.6.33 with commit be95745f01677245a061a8f51473ef5ec8ad008e and fixed in 6.18.51 with commit d06f91a52af11630c9f7e487f6daf242ac310cb8 Issue introduced in 2.6.33 with commit be95745f01677245a061a8f51473ef5ec8ad008e and fixed in 7.2.5 with commit 1e5cd8bc902331ff801df88cbb299029ae062753 Issue introduced in 2.6.33 with commit be95745f01677245a061a8f51473ef5ec8ad008e and fixed in 7.3-rc1 with commit 956e7da12c114f13c63d126ab1d79c3b6a819060
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-89953
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/mtd/mtdoops.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/477d61d54e097e90f748aa18d013805abd56bcbd https://git.kernel.org/stable/c/a91ac71e67c3e01ed9afd9841435bebb930293f8 https://git.kernel.org/stable/c/698944132083d143ef965c0090ee14ba1d9e1a5f https://git.kernel.org/stable/c/f25c804947e0a28c15e73da8e2e0db959cbed716 https://git.kernel.org/stable/c/8414f0e9f707226de20b48c7048179fd86d352fc https://git.kernel.org/stable/c/d06f91a52af11630c9f7e487f6daf242ac310cb8 https://git.kernel.org/stable/c/1e5cd8bc902331ff801df88cbb299029ae062753 https://git.kernel.org/stable/c/956e7da12c114f13c63d126ab1d79c3b6a819060