CVE-2026-53156: nvmem: core: fix use-after-free bugs in error paths
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
nvmem: core: fix use-after-free bugs in error paths
Fix several instances of error paths in which we call __nvmem_device_put() - which may end up freeing the underlying memory and other resources - and then keep on using the nvmem structure. Always put the reference to the nvmem device as the last step before returning the error code.
The Linux kernel CVE team has assigned CVE-2026-53156 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.20 with commit e888d445ac33a5b0288d670ecd970908b13f07cd and fixed in 6.12.94 with commit e0d38bf47a72da2f02c9fa6f752cd66d977cd7f7 Issue introduced in 4.20 with commit e888d445ac33a5b0288d670ecd970908b13f07cd and fixed in 6.18.36 with commit cb85ef5a227b3662b88f4d849a1aad43bfe7f5ae Issue introduced in 4.20 with commit e888d445ac33a5b0288d670ecd970908b13f07cd and fixed in 7.0.13 with commit 40e2a459c0dd1333b2343831480a0ad80dc07614 Issue introduced in 4.20 with commit e888d445ac33a5b0288d670ecd970908b13f07cd and fixed in 7.1 with commit 5b6b6fc491899d583eaa75344e094796ae9b530b
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-53156
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/nvmem/core.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/e0d38bf47a72da2f02c9fa6f752cd66d977cd7f7 https://git.kernel.org/stable/c/cb85ef5a227b3662b88f4d849a1aad43bfe7f5ae https://git.kernel.org/stable/c/40e2a459c0dd1333b2343831480a0ad80dc07614 https://git.kernel.org/stable/c/5b6b6fc491899d583eaa75344e094796ae9b530b