CVE-2022-48753: block: fix memory leak in disk_register_independent_access_ranges
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
block: fix memory leak in disk_register_independent_access_ranges
kobject_init_and_add() takes reference even when it fails. According to the doc of kobject_init_and_add()
If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object.
Fix this issue by adding kobject_put().
Callback function blk_ia_ranges_sysfs_release() in kobject_put() can handle the pointer "iars" properly.
The Linux kernel CVE team has assigned CVE-2022-48753 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.16 with commit a2247f19ee1c and fixed in 5.16.5 with commit fe4214a07e0b Issue introduced in 5.16 with commit a2247f19ee1c and fixed in 5.17 with commit 83114df32ae7
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-48753
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:
block/blk-ia-ranges.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/fe4214a07e0b53d2af711f57519e33739c5df23f https://git.kernel.org/stable/c/83114df32ae779df57e0af99a8ba6c3968b2ba3d