CVE-2026-89896: media: cedrus: fix memory leak in cedrus_init_ctrls()
In the Linux kernel, the following vulnerability has been resolved:
media: cedrus: fix memory leak in cedrusinitctrls()
In cedrusinitctrls(), the V4L2 control handler is initialized before allocating memory for ctx->ctrls. If this allocation fails, the function returns -ENOMEM without freeing the previously allocated handler resources, leading to a memory leak.
Fix this by calling v4l2ctrlhandlerfree() on the ctx->ctrls allocation failure path.
The bug was first flagged by an experimental analysis tool we are developing for kernel memory-management bugs while analyzing v6.13-rc1. The tool is still under development and is not yet publicly available. Manual inspection confirms that the bug is still present in v7.1.1.
An x8664 allyesconfig build showed no new warnings. As we do not have an Allwinner SoC or board with a Cedrus VPU available to test with, no runtime testing was able to be performed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel (media: cedrus)to a version that resolves this vulnerability.Fixed in v6.13-rc1 - Configuration
In cedrus_init_ctrls(), free the previously initialized V4L2 control handler by calling v4l2_ctrl_handler_free() when allocation for ctx->ctrls fails; ensure the failure path returns -ENOMEM without leaking resources.
cedrus_init_ctrls (media: cedrus) v4l2_ctrl_handler_free on ctx->ctrls allocation failure path = call v4l2_ctrl_handler_free() and return -ENOMEM after freeing handler
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
The affected code is in the Linux kernel's Cedrus media driver. Exposure is relevant to systems using the Cedrus VPU driver; the provided data does not identify specific hardware models or configurations.
What condition triggers the memory leak?
The leak occurs when allocation of ctx->ctrls fails after the V4L2 control handler has already been initialized. The failure path returns -ENOMEM without freeing the handler resources.
How can the issue be mitigated if an update cannot be applied immediately?
The provided fix frees the V4L2 control handler when ctx->ctrls allocation fails. No alternative operational mitigation is provided in the available data.
What versions are known to contain the issue?
Manual inspection confirmed the bug is present in Linux kernel v7.1.1. The issue was also identified while analyzing v6.13-rc1; the provided data does not establish the full affected version range.