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 B93DC30147C for ; Tue, 19 Aug 2025 17:20:19 +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=1755624019; cv=none; b=EwvfmZ6lXPtrtjUmrjbA7FEoJqBjvKiQNFFDWw8DIg795KGCEQA2rJsiPrd5HRGN/Qa1XNe3VY8ffYLvlb+U8eN1t0ShlJER48V451HyLjvRj2S9eHiMlt9/93BFMZ73K7jBsRX8qhULF2yReWFU0kii7kgjvjzwDe01RF65V2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755624019; c=relaxed/simple; bh=Lfu3vBC7LEpGp0T9k76GSbJ2nika18e6gfeO1EOWCrI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Muxt3VlCUyZbRiNyoBGdAqzSHomzWs/hiaacbbzf882Q1VWxHvmHcCeU8IexQmU3ZvG9Ps0LtvdNav4fPg0ZUTt0vXrfGf7XXA/YdPBo6wS4Vpv6tieyP5sS5V12bfpxHWhLoz7bTxHXBP4jSYcWmILbLqXUbKXBQeqbp3dmgwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=acUoSf4U; 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="acUoSf4U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1191EC116B1; Tue, 19 Aug 2025 17:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755624019; bh=Lfu3vBC7LEpGp0T9k76GSbJ2nika18e6gfeO1EOWCrI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=acUoSf4U1kHCkgh0wiYrgQTto0VeMdtXdvi7Q0AHXn4BK+3wniLj7nRq9Jqnwl9za Dz01JUsyiHyqqo0EFDEPFTGxB6CwWzEVCipnPhgDtEfO62zEW/CQKoIAn99n9epWwp FJg4+ZNgLuGgbzSfLawWvqy768wLL+IhUHYCaXns= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38563: perf/core: Prevent VMA split of buffer mappings Date: Tue, 19 Aug 2025 19:18:10 +0200 Message-ID: <2025081907-CVE-2025-38563-81e4@gregkh> X-Mailer: git-send-email 2.50.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=3917; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=zVBjNsZbwXsNe4BTFuRrblgBVBZK2RqVqunzEvgGkrQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlLNl7YFNi9ZP2/B5E96W5qNQvsjjqFTn5y6d/d+9YBp xvqrCpyO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi95IZ5mk2/CxiPGWu+MLu 08SzBbM//CqUnMiwYNrhU05q2f5syx75Xdslcq12x9GJugA= 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: perf/core: Prevent VMA split of buffer mappings The perf mmap code is careful about mmap()'ing the user page with the ringbuffer and additionally the auxiliary buffer, when the event supports it. Once the first mapping is established, subsequent mapping have to use the same offset and the same size in both cases. The reference counting for the ringbuffer and the auxiliary buffer depends on this being correct. Though perf does not prevent that a related mapping is split via mmap(2), munmap(2) or mremap(2). A split of a VMA results in perf_mmap_open() calls, which take reference counts, but then the subsequent perf_mmap_close() calls are not longer fulfilling the offset and size checks. This leads to reference count leaks. As perf already has the requirement for subsequent mappings to match the initial mapping, the obvious consequence is that VMA splits, caused by resizing of a mapping or partial unmapping, have to be prevented. Implement the vm_operations_struct::may_split() callback and return unconditionally -EINVAL. That ensures that the mapping offsets and sizes cannot be changed after the fact. Remapping to a different fixed address with the same size is still possible as it takes the references for the new mapping and drops those of the old mapping. The Linux kernel CVE team has assigned CVE-2025-38563 to this issue. Affected and fixed versions =========================== Issue introduced in 4.1 with commit 45bfb2e50471abbbfd83d40d28c986078b0d24ff and fixed in 6.1.148 with commit 7b84cb58d1f0aa07656802eae24689566e5f5b1b Issue introduced in 4.1 with commit 45bfb2e50471abbbfd83d40d28c986078b0d24ff and fixed in 6.6.102 with commit 6757a31a8e295ae4f01717a954afda173f25a121 Issue introduced in 4.1 with commit 45bfb2e50471abbbfd83d40d28c986078b0d24ff and fixed in 6.12.42 with commit e529888b7e8092912dd8789bdfc76685ccd2ff5f Issue introduced in 4.1 with commit 45bfb2e50471abbbfd83d40d28c986078b0d24ff and fixed in 6.15.10 with commit ff668930871e0198c7f4e325058b8b7c286787bd Issue introduced in 4.1 with commit 45bfb2e50471abbbfd83d40d28c986078b0d24ff and fixed in 6.16.1 with commit 65311aad4c808bedad0c05d9bb8b06c47dae73eb Issue introduced in 4.1 with commit 45bfb2e50471abbbfd83d40d28c986078b0d24ff and fixed in 6.17-rc1 with commit b024d7b56c77191cde544f838debb7f8451cd0d6 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-38563 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: kernel/events/core.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/7b84cb58d1f0aa07656802eae24689566e5f5b1b https://git.kernel.org/stable/c/6757a31a8e295ae4f01717a954afda173f25a121 https://git.kernel.org/stable/c/e529888b7e8092912dd8789bdfc76685ccd2ff5f https://git.kernel.org/stable/c/ff668930871e0198c7f4e325058b8b7c286787bd https://git.kernel.org/stable/c/65311aad4c808bedad0c05d9bb8b06c47dae73eb https://git.kernel.org/stable/c/b024d7b56c77191cde544f838debb7f8451cd0d6