| From bippy-5f407fcff5a0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2021-47467: kunit: fix reference count leak in kfree_at_end |
| |
| Description |
| =========== |
| |
| In the Linux kernel, the following vulnerability has been resolved: |
| |
| kunit: fix reference count leak in kfree_at_end |
| |
| The reference counting issue happens in the normal path of |
| kfree_at_end(). When kunit_alloc_and_get_resource() is invoked, the |
| function forgets to handle the returned resource object, whose refcount |
| increased inside, causing a refcount leak. |
| |
| Fix this issue by calling kunit_alloc_resource() instead of |
| kunit_alloc_and_get_resource(). |
| |
| Fixed the following when applying: |
| Shuah Khan <skhan@linuxfoundation.org> |
| |
| CHECK: Alignment should match open parenthesis |
| + kunit_alloc_resource(test, NULL, kfree_res_free, GFP_KERNEL, |
| (void *)to_free); |
| |
| The Linux kernel CVE team has assigned CVE-2021-47467 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Issue introduced in 5.14 with commit 1d71307a6f94df3750f8f884545a769e227172fe and fixed in 5.14.15 with commit bbdd158b40b66a9403391a517f24ef6613573446 |
| Issue introduced in 5.14 with commit 1d71307a6f94df3750f8f884545a769e227172fe and fixed in 5.15 with commit f62314b1ced25c58b86e044fc951cd6a1ea234cf |
| |
| 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-2021-47467 |
| 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: |
| lib/kunit/executor_test.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/bbdd158b40b66a9403391a517f24ef6613573446 |
| https://git.kernel.org/stable/c/f62314b1ced25c58b86e044fc951cd6a1ea234cf |