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 D3751288520 for ; Wed, 18 Jun 2025 11:04:53 +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=1750244694; cv=none; b=CkV67dz6bxathx1RswJjVHQzZLSkl4QDdBE7k6T54IrYRHccHCHABoA5hgNVYThjXRv9bCyR8ix96WvriEOW5bbSrxtKV4bQm+4jw6N2HQoKAz8C76eYswxeTNYH3ps/1FQjsxJxjtQMhROIw1PBY0xFFcjL5ClRVMEEUGNRPs8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244694; c=relaxed/simple; bh=s8ZIIJZeO/WlNkhLbix5wyiBCQq/KYdgJeaV+VXiJ2U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qt4jZjyX2svb4ktLnKvUF9l/TIJirVPVMHBsbZ/HYutskvsYQdp8R2nKYldw5ZHCuZRm4cRbnojXOCkA7qeLR/EK4KcE2ZMMqDvIaoFg44lRW0wSEsBMwzfjkuWuLQE8fvQwFaqseQQVYbueMGf63jqZAGBYBZoCnbQL3BEJwSA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NEc099GV; 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="NEc099GV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00774C4CEE7; Wed, 18 Jun 2025 11:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244693; bh=s8ZIIJZeO/WlNkhLbix5wyiBCQq/KYdgJeaV+VXiJ2U=; h=From:To:Cc:Subject:Date:Reply-to:From; b=NEc099GVU421cqDXaQxFEt94rUkkVbxIy13vGZJnlbsTZDs8z3ziquRw3SPyv1vSA VsHnFkz+ZC6cXMwSaYEcsjchIIVlRGLdiFcQuvOMe6TA61hcMidMy1YxqQoNAiS2mJ eWAfcnp8alz71OELn4eNhk1aBIcJl8NBH3miNFw8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50007: xfrm: fix refcount leak in __xfrm_policy_check() Date: Wed, 18 Jun 2025 13:01:12 +0200 Message-ID: <2025061830-CVE-2022-50007-95d2@gregkh> X-Mailer: git-send-email 2.49.0 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=3548; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Xebn1zr7/CZJH8+R1jgl6oxkcfAvE/K2N6K++7Z+UMg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc/xW7zl7f19Z+omn23STO7gvTDZ795vzwEXbkw1Gi 1oTwm+f7IhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJLClgmJ+lsbYuKvpfwZQ3 U2cvLzer1U8Wk2SYyVgUry5vlLH0dbW0tmXVp1C2ycvXAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: xfrm: fix refcount leak in __xfrm_policy_check() The issue happens on an error path in __xfrm_policy_check(). When the fetching process of the object `pols[1]` fails, the function simply returns 0, forgetting to decrement the reference count of `pols[0]`, which is incremented earlier by either xfrm_sk_policy_lookup() or xfrm_policy_lookup(). This may result in memory leaks. Fix it by decreasing the reference count of `pols[0]` in that path. The Linux kernel CVE team has assigned CVE-2022-50007 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.19 with commit 134b0fc544ba062498451611cb6f3e4454221b3d and fixed in 4.9.327 with commit 18e6b6e2555c93f5ca09f2b85ef1fa025c8accea Issue introduced in 2.6.19 with commit 134b0fc544ba062498451611cb6f3e4454221b3d and fixed in 4.14.292 with commit 8f94b933103ee1bda119543369cc18a1be5536db Issue introduced in 2.6.19 with commit 134b0fc544ba062498451611cb6f3e4454221b3d and fixed in 4.19.257 with commit 0769491a8acd3e85ca4c3f65080eac2c824262df Issue introduced in 2.6.19 with commit 134b0fc544ba062498451611cb6f3e4454221b3d and fixed in 5.4.212 with commit 63da7a2bbf3f28094920e0b8a17d2571a9bd842d Issue introduced in 2.6.19 with commit 134b0fc544ba062498451611cb6f3e4454221b3d and fixed in 5.10.140 with commit 1305d7d4f35ca6f214a2d23b075aa6a924cff3be Issue introduced in 2.6.19 with commit 134b0fc544ba062498451611cb6f3e4454221b3d and fixed in 5.15.64 with commit 26ad2398fe4984f4f6f930bcb3bc9047fa77265b Issue introduced in 2.6.19 with commit 134b0fc544ba062498451611cb6f3e4454221b3d and fixed in 5.19.6 with commit d66c052879791313f90c0584420f196a038fb8b8 Issue introduced in 2.6.19 with commit 134b0fc544ba062498451611cb6f3e4454221b3d and fixed in 6.0 with commit 9c9cb23e00ddf45679b21b4dacc11d1ae7961ebe 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-50007 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: net/xfrm/xfrm_policy.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/18e6b6e2555c93f5ca09f2b85ef1fa025c8accea https://git.kernel.org/stable/c/8f94b933103ee1bda119543369cc18a1be5536db https://git.kernel.org/stable/c/0769491a8acd3e85ca4c3f65080eac2c824262df https://git.kernel.org/stable/c/63da7a2bbf3f28094920e0b8a17d2571a9bd842d https://git.kernel.org/stable/c/1305d7d4f35ca6f214a2d23b075aa6a924cff3be https://git.kernel.org/stable/c/26ad2398fe4984f4f6f930bcb3bc9047fa77265b https://git.kernel.org/stable/c/d66c052879791313f90c0584420f196a038fb8b8 https://git.kernel.org/stable/c/9c9cb23e00ddf45679b21b4dacc11d1ae7961ebe