{"id":"CVE-2021-47467","published":"2024-05-22T06:23:26Z","modified":"2026-05-11T13:55:17Z","title":"kunit: fix reference count leak in kfree_at_end","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nkunit: fix reference count leak in kfree_at_end\n\nThe reference counting issue happens in the normal path of\nkfree_at_end(). When kunit_alloc_and_get_resource() is invoked, the\nfunction forgets to handle the returned resource object, whose refcount\nincreased inside, causing a refcount leak.\n\nFix this issue by calling kunit_alloc_resource() instead of\nkunit_alloc_and_get_resource().\n\nFixed the following when applying:\nShuah Khan <skhan@linuxfoundation.org>\n\nCHECK: Alignment should match open parenthesis\n+\tkunit_alloc_resource(test, NULL, kfree_res_free, GFP_KERNEL,\n \t\t\t\t     (void *)to_free);","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.00489,"percentile":0.43015,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/bbdd158b40b66a9403391a517f24ef6613573446","tags":[]},{"url":"https://git.kernel.org/stable/c/f62314b1ced25c58b86e044fc951cd6a1ea234cf","tags":[]}],"priority":{"score":12.3,"factors":[{"name":"EPSS percentile","points":8.6},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 1d71307a6f94df3750f8f884545a769e227172fe, < bbdd158b40b66a9403391a517f24ef6613573446",">= 1d71307a6f94df3750f8f884545a769e227172fe, < f62314b1ced25c58b86e044fc951cd6a1ea234cf"]},{"vendor":"Linux","product":"Linux","versions":["5.14"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-05-22T15:53:40.956714Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2021-34472","exploited":false,"provenance":"source"}}