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 D6E60134BD for ; Fri, 25 Jul 2025 12:48:15 +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=1753447695; cv=none; b=CAie2MzCl4BFA4dn4PTzGjpeml6/Auw089xA4Xh1HP8ZRIikZM7VGB/+iMUGd0oktkNZ3/NkoxoAoLH9fFKfpb5Ri9q1DSSRqglEqXEHhIadzXpRD0CcPUuE1pXlc4/8DTHGdn9r3OZClE2gAodIZ0oUmPxv5IzM7kOigXbKT2w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753447695; c=relaxed/simple; bh=7PWm7f59HaWRsQ5+mTQZIT9tlzV3yEWzJhFnLw8P8EU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mDmU64oOvM/uhxp9f0XfcT3ujwLCGq1sTi5Qljarim03BsrLb/1IPWXBgFA7HrtjtCgPdlc9pZeQwIvieJ810g5kWdNtLzpIzMYKlyKDi7zLkTTyRM7rnj9y0izc9cKwsH0at2DNrWZx/vhw+7L4GaYoA8iPFiMt8RV8VtDPaw0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Uc+9oSAs; 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="Uc+9oSAs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 136A5C4CEE7; Fri, 25 Jul 2025 12:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753447695; bh=7PWm7f59HaWRsQ5+mTQZIT9tlzV3yEWzJhFnLw8P8EU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Uc+9oSAs3Mqdbd1QmoyBSxO5tSTIXGMNLFw3aA7VAPQRNndQseVjxfD1x8E2Wojzi CoffVp/ef4/CPjMHu057YBU/aetiBHezvwZyxFzy/75/8V0qGA6TI8mBXb1yVHb4r5 isdjxlr1+bPxD5zZm94sI/ctHBk9bNGyxhuyephQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38364: maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate() Date: Fri, 25 Jul 2025 14:48:05 +0200 Message-ID: <2025072558-CVE-2025-38364-74db@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=3262; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=6BEluCSS8Go0RQdBlLSG66hie08UtxSB+S/uiADRtmQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnNNf/y/z41OulSpv3w6SqRH0s0U5WeH7njUiEpsuTO1 W9rjqcHdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE3DczzC/w4dOf+fgrm/Xi 9DutrV1PXnqufMcw350htXX2pNw9GUGrQmZcP8IbsFYgEwA= 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: maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate() Temporarily clear the preallocation flag when explicitly requesting allocations. Pre-existing allocations are already counted against the request through mas_node_count_gfp(), but the allocations will not happen if the MA_STATE_PREALLOC flag is set. This flag is meant to avoid re-allocating in bulk allocation mode, and to detect issues with preallocation calculations. The MA_STATE_PREALLOC flag should also always be set on zero allocations so that detection of underflow allocations will print a WARN_ON() during consumption. User visible effect of this flaw is a WARN_ON() followed by a null pointer dereference when subsequent requests for larger number of nodes is ignored, such as the vma merge retry in mmap_region() caused by drivers altering the vma flags (which happens in v6.6, at least) The Linux kernel CVE team has assigned CVE-2025-38364 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa and fixed in 6.1.146 with commit d69cd64bd5af41c6fd409313504089970edaf02f Issue introduced in 6.1 with commit 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa and fixed in 6.6.99 with commit e63032e66bca1d06e600033f3369ba3db3af0870 Issue introduced in 6.1 with commit 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa and fixed in 6.12.36 with commit cf95f8426f889949b738f51ffcd72884411f3a6a Issue introduced in 6.1 with commit 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa and fixed in 6.15.5 with commit 9e32f4700867abbd5d19abfcf698dbd0d2ce36a4 Issue introduced in 6.1 with commit 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa and fixed in 6.16-rc4 with commit fba46a5d83ca8decb338722fb4899026d8d9ead2 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-38364 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: lib/maple_tree.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/d69cd64bd5af41c6fd409313504089970edaf02f https://git.kernel.org/stable/c/e63032e66bca1d06e600033f3369ba3db3af0870 https://git.kernel.org/stable/c/cf95f8426f889949b738f51ffcd72884411f3a6a https://git.kernel.org/stable/c/9e32f4700867abbd5d19abfcf698dbd0d2ce36a4 https://git.kernel.org/stable/c/fba46a5d83ca8decb338722fb4899026d8d9ead2