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 371A9182D11 for ; Thu, 30 May 2024 15:35:46 +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=1717083347; cv=none; b=Mr0gnPsg2OIM/aAEfoLk+CHAURdBYbQ14Giy+b1F9IFbpIhchK8GZkM7kbGGfjJByI1G3SPFW5y/lSGt7ahlXTr2D18UBSyGArBashQDTJubWx3CMorFLb+6MEXCc0W6RHpiXpmMXjBx+xnBF3w9zt4/oJqZn9/5tbe4WTuRzys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717083347; c=relaxed/simple; bh=Ul988Uo6g0gzA+WAfosjTIMWPFGyKldJCSJ2G2DTYI8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=u1Zi5iWxBymNdq2gJo33/JJaRbrIzOlnElOyiMDDXTsbdFiqmD0qNLiA+sqiZz0rKgwdCV/fz+tB7ZhXMyHZP/Tiut8ZHG7mG33/aXKlXH0bbE1o0fUX0mnZKRJS5RkoNYqaTMnf1oScWVUO0YyYLQrCdCnvDMfEiLIF8nopRjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ifelhq9O; 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="Ifelhq9O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60D09C2BBFC; Thu, 30 May 2024 15:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717083346; bh=Ul988Uo6g0gzA+WAfosjTIMWPFGyKldJCSJ2G2DTYI8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Ifelhq9OOWuLANLhG6Q6GWCGeeASysZAvR8SSaQvpBm7cbCo4TZsil1DTofjS5a/V lCfT/Z6oI0H0fcR2izdxwyIBSU4ehHFw3nMMBGnEq//Cx2biLGykamLo6f0EIhur+Q uDT/uI3coabKyoStXUXA4kI1kfI9jE1qh75gS3a0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-36943: fs/proc/task_mmu: fix loss of young/dirty bits during pagemap scan Date: Thu, 30 May 2024 17:35:40 +0200 Message-ID: <2024053038-CVE-2024-36943-de68@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=2265; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Ul988Uo6g0gzA+WAfosjTIMWPFGyKldJCSJ2G2DTYI8=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkRc05VLVq6UFfu1RodhiPLVUMmzT/940SDDVPtf5nN8 QFtFw+IdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE4vgY5sfc4uZuncxxYaPL 80qzV9PZz4TmrGFYcHLPB5l1aVekne1rG2ZO9um5HtEhBQA= 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: fs/proc/task_mmu: fix loss of young/dirty bits during pagemap scan make_uffd_wp_pte() was previously doing: pte = ptep_get(ptep); ptep_modify_prot_start(ptep); pte = pte_mkuffd_wp(pte); ptep_modify_prot_commit(ptep, pte); But if another thread accessed or dirtied the pte between the first 2 calls, this could lead to loss of that information. Since ptep_modify_prot_start() gets and clears atomically, the following is the correct pattern and prevents any possible race. Any access after the first call would see an invalid pte and cause a fault: pte = ptep_modify_prot_start(ptep); pte = pte_mkuffd_wp(pte); ptep_modify_prot_commit(ptep, pte); The Linux kernel CVE team has assigned CVE-2024-36943 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit 52526ca7fdb9 and fixed in 6.8.10 with commit 74b3d66f91d9 Issue introduced in 6.7 with commit 52526ca7fdb9 and fixed in 6.9 with commit c70dce4982ce 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-36943 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: fs/proc/task_mmu.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/74b3d66f91d9f539f99faad74d796fa9a389a015 https://git.kernel.org/stable/c/c70dce4982ce1718bf978a35f8e26160b82081f4