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 D065A16A92D for ; Tue, 15 Oct 2024 10:48:44 +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=1728989324; cv=none; b=cVRxPrg19OiwqFl9O+gC0hFV43EvntDzrxDUnZbe2P3aMuPGwRMzqc2+NHMvkRKQZ2LAyVudQ/Y/Nv5tY5EzRbCEGq6f+NZ6ncCfLNy6KYm33qGtYLfqmLumULHEmfqSKBekH1LXh/77w+ZZ6XK+LLbLnyVrinHhgUdCASs2XsY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728989324; c=relaxed/simple; bh=4faf5WE7h1naD3GfsI+uQfrJnIMiSy29rq2b9yK21Y4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Lxd6z7UEfS0S7861LViw5BNyuTDePNNRU7ER7OMj10MobhmiSd1lvLBLOIz/KJJxPs7T+XgUps6bB0XYd+gPndsZeiFSU5p/CUzXnTePbxKvXsp29If6N6nt+NRGkAw7F5xJOry5Q4Q/+1dqjM67Jdm9u6Fe0/dlQFFDfl3fKyg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XglVRPtt; 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="XglVRPtt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F16EEC4CEC6; Tue, 15 Oct 2024 10:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728989324; bh=4faf5WE7h1naD3GfsI+uQfrJnIMiSy29rq2b9yK21Y4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XglVRPttV43hFmoDo4poRjRDnmRMGad495vY+Miv1CP4lQmY+4RjzOHKnLlMBgBgV Ui8j6BDPNkJ1WEiKzPUdNr/Nue6G/kTAM6LyEfPPz4j/rL6aDl+AkbjwVI2KCLsS/J dsnUk9DhJzNJvc1i8rizBdJNxEK89x3wux41yatI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-47674: mm: avoid leaving partial pfn mappings around in error case Date: Tue, 15 Oct 2024 12:48:39 +0200 Message-ID: <2024101538-CVE-2024-47674-ba1f@gregkh> X-Mailer: git-send-email 2.47.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=2637; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4faf5WE7h1naD3GfsI+uQfrJnIMiSy29rq2b9yK21Y4=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl8Hm0eWTJ7/S4IJfQJvluWs+if4v1V9ypPVYm6e7aLH fgZo+3dEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABMx/sKw4EYay+uHf1QaXd4c /W1sKnVWy91nOcN8X6uqDReM2N+tnrylVVcqbvWP5APWAA== 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: avoid leaving partial pfn mappings around in error case As Jann points out, PFN mappings are special, because unlike normal memory mappings, there is no lifetime information associated with the mapping - it is just a raw mapping of PFNs with no reference counting of a 'struct page'. That's all very much intentional, but it does mean that it's easy to mess up the cleanup in case of errors. Yes, a failed mmap() will always eventually clean up any partial mappings, but without any explicit lifetime in the page table mapping itself, it's very easy to do the error handling in the wrong order. In particular, it's easy to mistakenly free the physical backing store before the page tables are actually cleaned up and (temporarily) have stale dangling PTE entries. To make this situation less error-prone, just make sure that any partial pfn mapping is torn down early, before any other error handling. The Linux kernel CVE team has assigned CVE-2024-47674 to this issue. Affected and fixed versions =========================== Fixed in 6.1.111 with commit 65d0db500d7c Fixed in 6.6.52 with commit a95a24fcaee1 Fixed in 6.10.11 with commit 954fd4c81f22 Fixed in 6.11 with commit 79a61cc3fc04 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-47674 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/memory.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/65d0db500d7c07f0f76fc24a4d837791c4862cd2 https://git.kernel.org/stable/c/a95a24fcaee1b892e47d5e6dcc403f713874ee80 https://git.kernel.org/stable/c/954fd4c81f22c4b6ba65379a81fd252971bf4ef3 https://git.kernel.org/stable/c/79a61cc3fc0466ad2b7b89618a6157785f0293b3