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 8307A28313F for ; Wed, 18 Jun 2025 11:06:57 +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=1750244819; cv=none; b=tqdx6OVJMaS59xlxooP2Hc7jpn2GUhtC7xe1CCKHETo/pKXzxH9Wl+/p2p7L4kVTm8ifAE60GcaTXipl3Ebv1gI7EJTRDnRCNEcbRUnTvOrcphqulLcSyyfC6W6dcDK4jQtoQxUwcyLpfsM7IFG9pmefYgitkd9rhrdaTFbEKPg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244819; c=relaxed/simple; bh=rgSUrs7TUlwDlSWfNhU/wfUoBhCStqOPZLtpwrOMEQc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VOEPmS3ANUyPHrT+0ffCYtdGKwhyzv2aw3ysO9nUPuqh878twAfaXpX3ZgNcBt9/qXk3+dR/lPwgh57hXpcqcHp2QP75FibwflBEKXR9CLYEzn8r6gPULZIOIZLp6ibDPVy86AmSqgq0WXbuY+BinEOpYUyhu0JdutA9UnXV1Ds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SefccdZs; 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="SefccdZs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC26BC4CEE7; Wed, 18 Jun 2025 11:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244817; bh=rgSUrs7TUlwDlSWfNhU/wfUoBhCStqOPZLtpwrOMEQc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SefccdZsE9cc3Tc8EGfhjpr4+zK4Ww3NqgfVTgR6KUtF8pWT0sVCHyT+gRoA5TblP Cz7uRFW7bRm1o3ZexFiR0+SB4HwSV3g1xburJUgLvJ/ftyCYVwKeKRX50EnV8Yroq4 4FwXKjCEiNRlLBtl9jjmXS3qY59zcB/2A+cOA06g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50046: net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change() Date: Wed, 18 Jun 2025 13:01:51 +0200 Message-ID: <2025061844-CVE-2022-50046-9cac@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=2486; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=We5p+MXiariwdG0ulgFLAit8aaa6Fz62EjgMZfnJUgU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc2L6//V/09sZIH+d+d1uYf7y8m+VD16WFEyfwHs4b cnde7H6HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRPa8YFhz/PoH5SaOtlRiH +MW1/xP1bjxKY2OYpxM8dxnfg63Xr5cJ71m38QPfB/XYyQA= 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: net/sunrpc: fix potential memory leaks in rpc_sysfs_xprt_state_change() The issue happens on some error handling paths. When the function fails to grab the object `xprt`, it simply returns 0, forgetting to decrease the reference count of another object `xps`, which is increased by rpc_sysfs_xprt_kobj_get_xprt_switch(), causing refcount leaks. Also, the function forgets to check whether `xps` is valid before using it, which may result in NULL-dereferencing issues. Fix it by adding proper error handling code when either `xprt` or `xps` is NULL. The Linux kernel CVE team has assigned CVE-2022-50046 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b and fixed in 5.15.63 with commit c0434f0e058648649250b8ed6078b66d773de723 Issue introduced in 5.14 with commit 5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b and fixed in 5.19.4 with commit 76fbeb1662b1c56514325118a07fba74dc4c79fe Issue introduced in 5.14 with commit 5b7eb78486cd9ac58bfbd6d84ea0fe2d9fead03b and fixed in 6.0 with commit bfc48f1b0505ffcb03a6d749139b7577d6b81ae0 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-50046 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/sunrpc/sysfs.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/c0434f0e058648649250b8ed6078b66d773de723 https://git.kernel.org/stable/c/76fbeb1662b1c56514325118a07fba74dc4c79fe https://git.kernel.org/stable/c/bfc48f1b0505ffcb03a6d749139b7577d6b81ae0