Bug 2439844 (CVE-2026-23137) - CVE-2026-23137 kernel: of: unittest: Fix memory leak in unittest_data_add()
Summary: CVE-2026-23137 kernel: of: unittest: Fix memory leak in unittest_data_add()
Keywords:
Status: NEW
Alias: CVE-2026-23137
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-02-14 16:01 UTC by OSIDB Bzimport
Modified: 2026-02-16 08:54 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-02-14 16:01:23 UTC
In the Linux kernel, the following vulnerability has been resolved:

of: unittest: Fix memory leak in unittest_data_add()

In unittest_data_add(), if of_resolve_phandles() fails, the allocated
unittest_data is not freed, leading to a memory leak.

Fix this by using scope-based cleanup helper __free(kfree) for automatic
resource cleanup. This ensures unittest_data is automatically freed when
it goes out of scope in error paths.

For the success path, use retain_and_null_ptr() to transfer ownership
of the memory to the device tree and prevent double freeing.


Note You need to log in before you can comment on or make changes to this bug.