Please pick MTD OTP NVMEM double-free fix
Subsystems (2)
Hi,
Please pick commit 26300879cd8e4612dce66bb8f6ff7cd35fcf3e59 ("mtd: core:
avoid double-free of OTP NVMEM device") for 6.18.y. It fixes CVE-2026-98834.
If user OTP registration succeeds but factory OTP setup fails, mtd_otp_nvmem_add() unregisters the user NVMEM device but leaves mtd->otp_user_nvmem set, so later cleanup unregisters it a second time. The fix clears the pointer after unregistering it.
The fix is in 7.2.10 and in mainline since 7.3. It carries no stable tag and so far has been backported only to 7.2.y. 6.18.65 has the same error path, and the patch applies to it unchanged (one-line offset). Older stable series are affected as well; this request covers only 6.18.y.
Compiled drivers/mtd/mtdcore.o on 6.18.64 from a cumulative x86_64 tree using allmodconfig. No kernel boot or runtime test was performed.
An LLM was used to check applicability and stable-queue history and to draft this request; I reviewed the result.
Thanks,
Artem Dinaburg