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 B49B01F4712 for ; Fri, 27 Dec 2024 13:56:41 +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=1735307801; cv=none; b=Cvr5DcGLYi45jHCHe4i+BdaXBDbAwzxbOo4Txqs2ksYLr9IKCVnhZTl7xVQq2wKyouIBiLFoRiczi98tEr3Q1Q0v9adveG5m61+map6bLAE8ddaD1NnQB3KKvSq2yAY98UXYV3puLln9MS+s1YOkDNgJO5Vt+AbgOAsiKr9xWP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735307801; c=relaxed/simple; bh=oJeUIid7yjY67g9xZObgo08855ZW7ZovX+sGMbaHnt0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OyPMqkxWwVrxGl58ImT8U5ztIKI97zgsaSHpp8KvptMhyxnLmJMG/B2XOitzG+fGNmC1qb7v0d0NNwTqA6If8keaIVAzMWgr+m9UMyGCNPbIfJUPYpju17sZXQeZRUyvkJg9jg17FXVs0zb8cDpB/iHEbZEdcu50BINU/3wlXKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lUepJ0Nx; 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="lUepJ0Nx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C97E8C4CED0; Fri, 27 Dec 2024 13:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735307801; bh=oJeUIid7yjY67g9xZObgo08855ZW7ZovX+sGMbaHnt0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=lUepJ0NxwFkBj7Ik8ud6pBrM0UAeWwdD5j3N4haIewbFM2kVHX5tY7YXzF1GVlXWU HHDb2zb2urSqk2OozC8PvgC/5WAvXo36CAfHo3k7Az2LcvS4zV3TVKGUoPS3u6irWR inyXXrO0BlDbmXYAgzBAXtoIznOJZ8gv1vYl834E= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-53215: svcrdma: fix miss destroy percpu_counter in svc_rdma_proc_init() Date: Fri, 27 Dec 2024 14:53:01 +0100 Message-ID: <2024122731-CVE-2024-53215-7de4@gregkh> X-Mailer: git-send-email 2.47.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=3981; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oJeUIid7yjY67g9xZObgo08855ZW7ZovX+sGMbaHnt0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5G+Xt/rwzXtPWcT7w+/ln9aHNBwRLN3TdEZ8VaMMvs +r+64aSjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjI9TcM80NPeLcVnGhd9LfX sHdemYuJ2rWtmxjml2gINx/92/0lqJl3zqNN1gvDK6ZmAwA= 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: svcrdma: fix miss destroy percpu_counter in svc_rdma_proc_init() There's issue as follows: RPC: Registered rdma transport module. RPC: Registered rdma backchannel transport module. RPC: Unregistered rdma transport module. RPC: Unregistered rdma backchannel transport module. BUG: unable to handle page fault for address: fffffbfff80c609a PGD 123fee067 P4D 123fee067 PUD 123fea067 PMD 10c624067 PTE 0 Oops: Oops: 0000 [#1] PREEMPT SMP KASAN NOPTI RIP: 0010:percpu_counter_destroy_many+0xf7/0x2a0 Call Trace: __die+0x1f/0x70 page_fault_oops+0x2cd/0x860 spurious_kernel_fault+0x36/0x450 do_kern_addr_fault+0xca/0x100 exc_page_fault+0x128/0x150 asm_exc_page_fault+0x26/0x30 percpu_counter_destroy_many+0xf7/0x2a0 mmdrop+0x209/0x350 finish_task_switch.isra.0+0x481/0x840 schedule_tail+0xe/0xd0 ret_from_fork+0x23/0x80 ret_from_fork_asm+0x1a/0x30 If register_sysctl() return NULL, then svc_rdma_proc_cleanup() will not destroy the percpu counters which init in svc_rdma_proc_init(). If CONFIG_HOTPLUG_CPU is enabled, residual nodes may be in the 'percpu_counters' list. The above issue may occur once the module is removed. If the CONFIG_HOTPLUG_CPU configuration is not enabled, memory leakage occurs. To solve above issue just destroy all percpu counters when register_sysctl() return NULL. The Linux kernel CVE team has assigned CVE-2024-53215 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit 1e7e55731628c90d8c701c45f9c3a3b8718840d6 and fixed in 5.15.174 with commit a12c897adf40b6e2b4a56e6912380c31bd7b2479 Issue introduced in 5.12 with commit 1e7e55731628c90d8c701c45f9c3a3b8718840d6 and fixed in 6.1.120 with commit 94d2d6d398706ab7218a26d61e12919c4b498e09 Issue introduced in 5.12 with commit 1e7e55731628c90d8c701c45f9c3a3b8718840d6 and fixed in 6.6.64 with commit 1c9a99c89e45b22eb556fd2f3f729f2683f247d5 Issue introduced in 5.12 with commit 1e7e55731628c90d8c701c45f9c3a3b8718840d6 and fixed in 6.11.11 with commit ebf47215d46992caea660ec01cd618005d9e687a Issue introduced in 5.12 with commit 1e7e55731628c90d8c701c45f9c3a3b8718840d6 and fixed in 6.12.2 with commit 20322edcbad82a60321a8615a99ca73a9611115f Issue introduced in 5.12 with commit 1e7e55731628c90d8c701c45f9c3a3b8718840d6 and fixed in 6.13-rc1 with commit ce89e742a4c12b20f09a43fec1b21db33f2166cd 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-2024-53215 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/xprtrdma/svc_rdma.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/a12c897adf40b6e2b4a56e6912380c31bd7b2479 https://git.kernel.org/stable/c/94d2d6d398706ab7218a26d61e12919c4b498e09 https://git.kernel.org/stable/c/1c9a99c89e45b22eb556fd2f3f729f2683f247d5 https://git.kernel.org/stable/c/ebf47215d46992caea660ec01cd618005d9e687a https://git.kernel.org/stable/c/20322edcbad82a60321a8615a99ca73a9611115f https://git.kernel.org/stable/c/ce89e742a4c12b20f09a43fec1b21db33f2166cd