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 0911D4596F for ; Mon, 20 May 2024 09:49:27 +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=1716198568; cv=none; b=Cvvlwp0yQHOjBoZjfDjWQBMMGVuE7tdc9LXPWbaYakpFTC1GSW0IVb8SOjU48GUB7k/+2wgQpYLAZNmlINeEfmft7ehCfNwvot22IWiPfP73D1k6QD+y+VXuJowIubZKi1DpnvYVnJwAqrS3tmOrin//kuRPDVGsCTqGRNinw1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716198568; c=relaxed/simple; bh=32SCw7kfNyXBjOVPBci9QvbVJ6E9YitK3CyJxSCfft0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qVC2d+ibpX+FbIXpjEio17B4fsTxHTJjWWMuJh5suPFD9ofU12+QoZ3Dq6opO/6lGgJ3IeRaiswTF4NpgSiiQuvEHCoge/x4RrIRybh0NzlUAw5gGZr55ErvczoV0Mr6QPP6GojHZTgd1LfAJ12Oi7tG1fc27HF89YX0pwN0Lp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O2x/FGqw; 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="O2x/FGqw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 443BAC2BD10; Mon, 20 May 2024 09:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716198567; bh=32SCw7kfNyXBjOVPBci9QvbVJ6E9YitK3CyJxSCfft0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=O2x/FGqw/iPTL8IdZ4SUMAj2tCtpWWRyF+pQVigEwjJvvwNZ0zLVWyzKEGgrpOIPc /u73//kmbCieCnF13BnSr+xcrNUrQoNz9J0Cm7G/Jm7d6yZAfOvX55UbhlQAaXdI92 Pz6uLi3Q9pGNxPTtWUL/7KBqTtgzGrFwkaxhytSI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35993: mm: turn folio_test_hugetlb into a PageType Date: Mon, 20 May 2024 11:48:29 +0200 Message-ID: <2024052021-CVE-2024-35993-0309@gregkh> X-Mailer: git-send-email 2.45.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=2838; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=32SCw7kfNyXBjOVPBci9QvbVJ6E9YitK3CyJxSCfft0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGneMqlH7CK/ZTF1vw5cH212L2JNksHjqG0W2+81f93ke PSfuEJBRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExk7l2GBSu9tH5r/TPNEmLa H3qwSvi+1cHFJgzzVHy6/af/WrNC3Pr1DWUHy+nrtH8pAAA= 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: turn folio_test_hugetlb into a PageType The current folio_test_hugetlb() can be fooled by a concurrent folio split into returning true for a folio which has never belonged to hugetlbfs. This can't happen if the caller holds a refcount on it, but we have a few places (memory-failure, compaction, procfs) which do not and should not take a speculative reference. Since hugetlb pages do not use individual page mapcounts (they are always fully mapped and use the entire_mapcount field to record the number of mappings), the PageType field is available now that page_mapcount() ignores the value in this field. In compaction and with CONFIG_DEBUG_VM enabled, the current implementation can result in an oops, as reported by Luis. This happens since 9c5ccf2db04b ("mm: remove HUGETLB_PAGE_DTOR") effectively added some VM_BUG_ON() checks in the PageHuge() testing path. [willy@infradead.org: update vmcoreinfo] Link: https://lkml.kernel.org/r/ZgGZUvsdhaT1Va-T@casper.infradead.org The Linux kernel CVE team has assigned CVE-2024-35993 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit 9c5ccf2db04b and fixed in 6.6.30 with commit 2431b5f2650d Issue introduced in 6.6 with commit 9c5ccf2db04b and fixed in 6.8.9 with commit 9fdcc5b6359d Issue introduced in 6.6 with commit 9c5ccf2db04b and fixed in 6.9 with commit d99e3140a4d3 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-35993 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: include/linux/page-flags.h include/trace/events/mmflags.h kernel/vmcore_info.c mm/hugetlb.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/2431b5f2650dfc47ce782d1ca7b02d6b3916976f https://git.kernel.org/stable/c/9fdcc5b6359dfdaa52a55033bf50e2cedd66eb32 https://git.kernel.org/stable/c/d99e3140a4d33e26066183ff727d8f02f56bec64