Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9EBF78C66 for ; Wed, 22 May 2024 06:23:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716359035; cv=none; b=PzcI6EIUUmLOwkKniIj2mIPWHsP4gjYPoF4iFWjUET08CDwYeH0i9yPWYZT1mO4ANBeB3t8NYXh7jfKb+/UHA9CYXIEWUgmiRGENXBpJECYNJFHdpUPvvgllW6Kc455xHcKP6H1f2+unwHvKQTpetnHLfDRVqau5eOTT+uR4JSs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716359035; c=relaxed/simple; bh=9uaqqRFej7YP6WnYs6ECX+X+T7dAbb/fP8TttbEdUYs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dxz8Ao+w5zD+h312TDAVR9Uo4pZJ0F3xPqppuP1g5y2GMnGMb5kkf2ScNr6yQ1qBx3A9A8gu1y4ODvdG8oTk515CpnYFZNqvyXaIg2A/QPaM4xz1ooRb+8BVm9/kOROpFcGcD5fysRxjYEHSpnINynKj7L+XmwTMFcf+ARVVQcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WloWxEmC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WloWxEmC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7095CC2BD11; Wed, 22 May 2024 06:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716359034; bh=9uaqqRFej7YP6WnYs6ECX+X+T7dAbb/fP8TttbEdUYs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=WloWxEmC4KY0GtZ5fueaT/EOFX4xVZmVwBXBxAk4OaokD11DqdegYYUsTKjbmIb4s eIRmab+Kr82dWHTdzctUKFOEAyp1/Otu6zyGeEUzbTGj6Q2DRG4XgS6aWJUvFAkeL6 Dk+QXu+Gq+wL7YVVPq2piHyRQ4QH5AnHqnVrW2w8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47467: kunit: fix reference count leak in kfree_at_end Date: Wed, 22 May 2024 08:23:33 +0200 Message-ID: <2024052227-CVE-2021-47467-29a2@gregkh> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2098; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9uaqqRFej7YP6WnYs6ECX+X+T7dAbb/fP8TttbEdUYs=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm+/fF7DXY/87q9ubjs2iGR4uMhm9KLGdLLZvw4ybfy1 ZyOP627O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiNycwLOi+z59ueOVsEk9f jMPVM+vXy/paijMs2OG1Ivcax9f5qpuKXScyGC3ku/y0DgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit 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 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 =========================== Fixed in 5.14.15 with commit bbdd158b40b6 Fixed in 5.15 with commit f62314b1ced2 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