Skip to contentSkip to conversation

proc-kcore-do-not-try-to-access-unaccepted-memory.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 4, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: proc/kcore: do not try to access unaccepted memory
has been removed from the -mm tree. Its filename was
proc-kcore-do-not-try-to-access-unaccepted-memory.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Adrian Hunter <[email protected]>
Subject: proc/kcore: do not try to access unaccepted memory
Date: Mon, 11 Sep 2023 14:21:14 +0300

Support for unaccepted memory was added recently, refer commit dcdfdd40fa82 ("mm: Add support for unaccepted memory"), whereby a virtual machine may need to accept memory before it can be used.

Do not try to access unaccepted memory because it can cause the guest to fail.

For /proc/kcore, which is read-only and does not support mmap, this means a read of unaccepted memory will return zeros.

Cc Ard Biesheuvel <[email protected]>
Cc Baoquan He <[email protected]>
Cc Borislav Petkov (AMD) <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Dave Young <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Tom Lendacky <[email protected]>
Cc Vivek Goyal <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 fs/proc/kcore.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/proc/kcore.c renamed from fs/proc/kcore.c~proc-kcore-do-not-try-to-access-unaccepted-memory +2 -1
@@ -546,7 +546,8 @@ static ssize_t read_kcore_iter(struct ki
 			 * and explicitly excluded physical ranges.
 			 */
 			if (!page || PageOffline(page) ||
-			    is_page_hwpoison(page) || !pfn_is_ram(pfn)) {
+			    is_page_hwpoison(page) || !pfn_is_ram(pfn) ||
+			    pfn_is_unaccepted_memory(pfn)) {
 				if (iov_iter_zero(tsz, iter) != tsz) {
 					ret = -EFAULT;
 					goto out;

_

Patches currently in -mm which might be from [email protected] are