CVE-2022-50547: media: solo6x10: fix possible memory leak in solo_sysfs_init()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
media: solo6x10: fix possible memory leak in solo_sysfs_init()
If device_register() returns error in solo_sysfs_init(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup().
The Linux kernel CVE team has assigned CVE-2022-50547 to this issue.
Affected and fixed versions
===========================
Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 4.9.337 with commit 83d4b1ae98a47a739fa5241300b86eb1110d5d63 Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 4.14.303 with commit b61509093e1af69e336a094d439b8e1137cb40d8 Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 4.19.270 with commit 963729538674be4cb8fa292529ecf32de0d6c6dd Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 5.4.229 with commit 7b02c50d3978840781808e13bc13137fb81286b5 Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 5.10.163 with commit 49060c0da57a381563e482e331dc9d4c3725b41b Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 5.15.86 with commit 7cf71bbe5d2ee12613f6e278888f5fc9c5c0cc2b Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 6.0.16 with commit d6db105bcfbdbbbd484e788a0ddf8140a4a8c486 Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 6.1.2 with commit 9416861170ba0da8ddb0f4fd2d28334f0ed3b9c2 Issue introduced in 3.10 with commit dcae5dacbce518513abf7776cb450b7bd95d722b and fixed in 6.2 with commit 7f5866dd96d95b74e439f6ee17b8abd8195179fb
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-2022-50547
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/pci/solo6x10/solo6x10-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/83d4b1ae98a47a739fa5241300b86eb1110d5d63 https://git.kernel.org/stable/c/b61509093e1af69e336a094d439b8e1137cb40d8 https://git.kernel.org/stable/c/963729538674be4cb8fa292529ecf32de0d6c6dd https://git.kernel.org/stable/c/7b02c50d3978840781808e13bc13137fb81286b5 https://git.kernel.org/stable/c/49060c0da57a381563e482e331dc9d4c3725b41b https://git.kernel.org/stable/c/7cf71bbe5d2ee12613f6e278888f5fc9c5c0cc2b https://git.kernel.org/stable/c/d6db105bcfbdbbbd484e788a0ddf8140a4a8c486 https://git.kernel.org/stable/c/9416861170ba0da8ddb0f4fd2d28334f0ed3b9c2 https://git.kernel.org/stable/c/7f5866dd96d95b74e439f6ee17b8abd8195179fb