mtd: core: avoid double-free of OTP NVMEM device
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel’s MTD OTP NVMEM setup can unregister a user OTP device twice if factory OTP setup fails after that device is registered. The input does not specify how an attacker could trigger this condition or whether network access, authentication, or user interaction is required.
Engineers running the Linux kernel should check whether their kernel includes the affected MTD OTP NVMEM code; affected versions are not specified.