Skip to contentSkip to conversation

CVE-2026-98834: mtd: core: avoid double-free of OTP NVMEM device

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 18

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

mtd: core: avoid double-free of OTP NVMEM device

If factory OTP setup fails after the user OTP NVMEM device has been registered, mtd_otp_nvmem_add() unregisters the user device but leaves mtd->otp_user_nvmem set. On an error, the caller unregisters it again. For -EOPNOTSUPP, registration continues and normal teardown unregisters it again.

Clear mtd->otp_user_nvmem after unregistering it.

The Linux kernel CVE team has assigned CVE-2026-98834 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.4 with commit e0489f6e221f5ddee6cb3bd51b992b790c5fa4b9 and fixed in 7.2.10 with commit cecf007418b93a2cbc94269e07fe2fb28f54d8fb
	Issue introduced in 6.4 with commit e0489f6e221f5ddee6cb3bd51b992b790c5fa4b9 and fixed in 7.3-rc6 with commit 26300879cd8e4612dce66bb8f6ff7cd35fcf3e59
	Issue introduced in 5.15.111 with commit 6d1af517817a760d7af3dee0fc4603645485495c
	Issue introduced in 6.1.28 with commit f1b4affca1e13706ca2eb075bf6775421236d7d1
	Issue introduced in 6.2.15 with commit 949476b8601bde5459048eebdf457c9db20addd8
	Issue introduced in 6.3.2 with commit dd6c85f98ff33b009b819090268cbf679dc208b9

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-98834

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/mtdcore.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/cecf007418b93a2cbc94269e07fe2fb28f54d8fb
	https://git.kernel.org/stable/c/26300879cd8e4612dce66bb8f6ff7cd35fcf3e59