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 5D63725F794 for ; Tue, 20 May 2025 15:23:20 +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=1747754600; cv=none; b=SWFUWwR2VUCkDm/YjrIa+JbUyhK5nsAe5Lyusa70SaL34u45cXGP1gLdUtRdjoiZBq1WAFVUkmd60aXzqVnTNhT2ht1k/iXY7BSjt1fCUHTJEyCWCFEBeNKyoX3ur8ttMkpORGnHSFW8MDYXeXLoUnL1JT/25Wc11tst1NTHbOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747754600; c=relaxed/simple; bh=PBDreRKHuAFVzACMFs/1W52gH4yY3hIXDIdgyiijobE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GWqQbepql9SoCScC/TPP7u1gTlmYTqZS6rXhxiZtUuIkKHcPjJT6ew8U7WiRHZOXIOUMwEyr+0m39WciYu/GJC2r7qknRNF7Vrv3xBQlpzHQkXPneT3/t4YgkaJ6ttp6gq3frOpOK3SjppEHZBJLQ6xq++e6yDVXSrT/mqWMC/A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QC3DI27k; 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="QC3DI27k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C10A2C4CEE9; Tue, 20 May 2025 15:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747754600; bh=PBDreRKHuAFVzACMFs/1W52gH4yY3hIXDIdgyiijobE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=QC3DI27k4pGfkX514axmtf88SHQRV5EbDoCEIOTgBVIUDAIcC1uVNtucSwwk3SZwa vTWGPukFk3mXrn8UWPtId2Ml3UVQF3CJL/7Ww4uUi/q01MVt0Z0b4L+dL3xAwhF1Op CXJZ8ACNMZP550esqrA24J5In9CPxS5XRGxpFinQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37898: powerpc64/ftrace: fix module loading without patchable function entries Date: Tue, 20 May 2025 17:21:55 +0200 Message-ID: <2025052054-CVE-2025-37898-a5ea@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=2764; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=QP+SGVwK/soCV+QdINe6DubA7baY0rnASRWuenNQFWI=; b=owGbwMvMwCRo6H6F97bub03G02pJDBk684RiCoWrFYpzFoQtnZbtYZHxIaW4wHr+k4l8658e1 90XdGJSRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEykRoZhwebVHZxnck4qP+ae v/Bz3CWFp7u2PmVYcLw6lSeb9WP8Dvn8zdyy3RVv3wt6AwA= 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: powerpc64/ftrace: fix module loading without patchable function entries get_stubs_size assumes that there must always be at least one patchable function entry, which is not always the case (modules that export data but no code), otherwise it returns -ENOEXEC and thus the section header sh_size is set to that value. During module_memory_alloc() the size is passed to execmem_alloc() after being page-aligned and thus set to zero which will cause it to fail the allocation (and thus module loading) as __vmalloc_node_range() checks for zero-sized allocs and returns null: [ 115.466896] module_64: cast_common: doesn't contain __patchable_function_entries. [ 115.469189] ------------[ cut here ]------------ [ 115.469496] WARNING: CPU: 0 PID: 274 at mm/vmalloc.c:3778 __vmalloc_node_range_noprof+0x8b4/0x8f0 ... [ 115.478574] ---[ end trace 0000000000000000 ]--- [ 115.479545] execmem: unable to allocate memory Fix this by removing the check completely, since it is anyway not helpful to propagate this as an error upwards. The Linux kernel CVE team has assigned CVE-2025-37898 to this issue. Affected and fixed versions =========================== Issue introduced in 6.13 with commit eec37961a56aa4f3fe1c33ffd48eec7d1bb0c009 and fixed in 6.14.6 with commit 358b559afec7806b9d01c2405b490e782c347022 Issue introduced in 6.13 with commit eec37961a56aa4f3fe1c33ffd48eec7d1bb0c009 and fixed in 6.15-rc5 with commit 534f5a8ba27863141e29766467a3e1f61bcb47ac 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-2025-37898 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: arch/powerpc/kernel/module_64.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/358b559afec7806b9d01c2405b490e782c347022 https://git.kernel.org/stable/c/534f5a8ba27863141e29766467a3e1f61bcb47ac