CVE-2022-49144: io_uring: fix memory leak of uid in files registration
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
io_uring: fix memory leak of uid in files registration
When there are no files for __io_sqe_files_scm() to process in the range, it'll free everything and return. However, it forgets to put uid.
The Linux kernel CVE team has assigned CVE-2022-49144 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.5 with commit 08a451739a9b5783f67de51e84cb6d9559bb9dc4 and fixed in 5.10.110 with commit b27de7011cb3ba14b047be2cee0ed8278368665b Issue introduced in 5.5 with commit 08a451739a9b5783f67de51e84cb6d9559bb9dc4 and fixed in 5.15.33 with commit 0853bd6885c2f293d88aaa7f7f1702c959b31680 Issue introduced in 5.5 with commit 08a451739a9b5783f67de51e84cb6d9559bb9dc4 and fixed in 5.16.19 with commit d6d7a517e81accf6ed22d55684baea763d2dbe43 Issue introduced in 5.5 with commit 08a451739a9b5783f67de51e84cb6d9559bb9dc4 and fixed in 5.17.2 with commit 7fa8b228c3f30060b9f4b24bb9aaaf41b0ae83fe Issue introduced in 5.5 with commit 08a451739a9b5783f67de51e84cb6d9559bb9dc4 and fixed in 5.18 with commit c86d18f4aa93e0e66cda0e55827cd03eea6bc5f8
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-49144
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:
fs/io_uring.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/b27de7011cb3ba14b047be2cee0ed8278368665b https://git.kernel.org/stable/c/0853bd6885c2f293d88aaa7f7f1702c959b31680 https://git.kernel.org/stable/c/d6d7a517e81accf6ed22d55684baea763d2dbe43 https://git.kernel.org/stable/c/7fa8b228c3f30060b9f4b24bb9aaaf41b0ae83fe https://git.kernel.org/stable/c/c86d18f4aa93e0e66cda0e55827cd03eea6bc5f8