CVE-2023-53300: media: hi846: Fix memleak in hi846_init_controls()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
media: hi846: Fix memleak in hi846_init_controls()
hi846_init_controls doesn't clean the allocated ctrl_hdlr in case there is a failure, which causes memleak. Add v4l2_ctrl_handler_free to free the resource properly.
The Linux kernel CVE team has assigned CVE-2023-53300 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.16 with commit e8c0882685f9152f0d729664a12bcbe749cb7736 and fixed in 6.1.28 with commit fd22e8c8c38fb40f130d3a60e52c59996a5bbae9 Issue introduced in 5.16 with commit e8c0882685f9152f0d729664a12bcbe749cb7736 and fixed in 6.2.15 with commit 12a80b1490e398f5ad7157508cf32b73511de5fc Issue introduced in 5.16 with commit e8c0882685f9152f0d729664a12bcbe749cb7736 and fixed in 6.3.2 with commit 07f0f15e5db60c5b0722049d3251ef4a46dc3b76 Issue introduced in 5.16 with commit e8c0882685f9152f0d729664a12bcbe749cb7736 and fixed in 6.4 with commit 2649c1a20e8e399ee955d0e22192f9992662c3d2
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-2023-53300
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/media/i2c/hi846.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/fd22e8c8c38fb40f130d3a60e52c59996a5bbae9 https://git.kernel.org/stable/c/12a80b1490e398f5ad7157508cf32b73511de5fc https://git.kernel.org/stable/c/07f0f15e5db60c5b0722049d3251ef4a46dc3b76 https://git.kernel.org/stable/c/2649c1a20e8e399ee955d0e22192f9992662c3d2