Skip to contentSkip to conversation

kmsan-fix-kmsan_copy_to_user-on-arches-with-overlapping-address-spaces.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 29, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: kmsan: fix kmsan_copy_to_user() on arches with overlapping address spaces
has been removed from the -mm tree. Its filename was
kmsan-fix-kmsan_copy_to_user-on-arches-with-overlapping-address-spaces.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: Ilya Leoshkevich <[email protected]>
Subject: kmsan: fix kmsan_copy_to_user() on arches with overlapping address spaces
Date: Fri, 21 Jun 2024 13:34:50 +0200

Comparing pointers with TASK_SIZE does not make sense when kernel and userspace overlap. Assume that we are handling user memory access in this case.

Cc Christian Borntraeger <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc David Rientjes <[email protected]>
Cc Dmitry Vyukov <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Hyeonggon Yoo <[email protected]>
Cc Joonsoo Kim <[email protected]>
Cc Marco Elver <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Masami Hiramatsu (Google) <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Steven Rostedt (Google) <[email protected]>
Cc Sven Schnelle <[email protected]>
Cc Vasily Gorbik <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 mm/kmsan/hooks.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/kmsan/hooks.c renamed from mm/kmsan/hooks.c~kmsan-fix-kmsan_copy_to_user-on-arches-with-overlapping-address-spaces +2 -1
@@ -267,7 +267,8 @@ void kmsan_copy_to_user(void __user *to,
 		return;
 
 	ua_flags = user_access_save();
-	if ((u64)to < TASK_SIZE) {
+	if (!IS_ENABLED(CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE) ||
+	    (u64)to < TASK_SIZE) {
 		/* This is a user memory access, check it. */
 		kmsan_internal_check_memory((void *)from, to_copy - left, to,
 					    REASON_COPY_TO_USER);

_

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