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 6DD5718FC75 for ; Sat, 11 Jan 2025 15:10:51 +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=1736608251; cv=none; b=DCeW+tdad0dSwaeVJvpee/oPQp7zighHo1C3HamWKDR8KS+dmWE6qOlhh5wGjnYCbLIaP+Si06SldWwR2zu2l9/mnI6VGCOwKxHaUk1VRYekfX06GxhOnV9iG9bDJUH6K9Wgmf1kUxvG+YHvv/S8SrOrKZTbwcOoSbzjzB9+NKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736608251; c=relaxed/simple; bh=1pGkeVkjLeoFyQKnXDeLH0ul07EEPoO+I0B8ZbdYQ30=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=doJsPtb06kX9rAa8x0DjSo0mqjfpRV8KuIZhX1qZkLc4/xGJOc61nCMlGfKUuKkEzdGHb2QTvoN35xPI6qqKJgKXz9ivHLvrzW6MT8ac0bYxdmJNhbfHgbNJexwFlnDJ2TW9cYDQPcVAcPaNbOVd9CbUHsallTn+3bxZBNGX+JE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sErnULjC; 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="sErnULjC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 660E6C4CED2; Sat, 11 Jan 2025 15:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736608250; bh=1pGkeVkjLeoFyQKnXDeLH0ul07EEPoO+I0B8ZbdYQ30=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sErnULjCRsRQSOZ+n5LxKkQDIeoxhAVeM7S0x0swIhAENONnVR9LvXw1CWR+SkxrC hV979jmYhUyieateilPZIG9Vza12+EOK+ryDoga1b6h/7yY29U0jzubHXuV9AfnJx/ P5DnI+PZ6xgXFii4bbEc/1I8gCWIX9KOsxeq1XQQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-57881: mm/page_alloc: don't call pfn_to_page() on possibly non-existent PFN in split_large_buddy() Date: Sat, 11 Jan 2025 16:10:47 +0100 Message-ID: <2025011146-CVE-2024-57881-7516@gregkh> X-Mailer: git-send-email 2.48.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=2344; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=1pGkeVkjLeoFyQKnXDeLH0ul07EEPoO+I0B8ZbdYQ30=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlNnd/POb1Iu3O0tNZf9fWnhya/f5+QSb314X1l5YNvn x+UzTP274hlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJWLQzLJgmu6zwnEmMz61y odjzy3pbxd8oNDIs2HSh7H5Zj+L1VGYhDT3lV2/rTx++BAA= 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: mm/page_alloc: don't call pfn_to_page() on possibly non-existent PFN in split_large_buddy() In split_large_buddy(), we might call pfn_to_page() on a PFN that might not exist. In corner cases, such as when freeing the highest pageblock in the last memory section, this could result with CONFIG_SPARSEMEM && !CONFIG_SPARSEMEM_EXTREME in __pfn_to_section() returning NULL and and __section_mem_map_addr() dereferencing that NULL pointer. Let's fix it, and avoid doing a pfn_to_page() call for the first iteration, where we already have the page. So far this was found by code inspection, but let's just CC stable as the fix is easy. The Linux kernel CVE team has assigned CVE-2024-57881 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit fd919a85cd55be5d00a6a7372071f44c8eafb825 and fixed in 6.12.7 with commit 4234ca9884bcae9e48ed38652d91696ad5cd591d Issue introduced in 6.10 with commit fd919a85cd55be5d00a6a7372071f44c8eafb825 and fixed in 6.13-rc4 with commit faeec8e23c10bd30e8aa759a2eb3018dae00f924 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-57881 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: mm/page_alloc.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/4234ca9884bcae9e48ed38652d91696ad5cd591d https://git.kernel.org/stable/c/faeec8e23c10bd30e8aa759a2eb3018dae00f924