[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250712192202.707192-8-gatlin.newhouse@gmail.com>
Date: Sat, 12 Jul 2025 19:21:52 +0000
From: Gatlin Newhouse <gatlin.newhouse@...il.com>
To: linux-hardening@...r.kernel.org
Cc: Gatlin Newhouse <gatlin.newhouse@...il.com>
Subject: [RFC v1 07/17] gup: add non-caching get_user call to fault_in_readable()
Adds non-caching call to fault_in_readable() for configurations with
SafeFetch enabled and disabled readable pages.
---
mm/gup.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mm/gup.c b/mm/gup.c
index 3c39cbbeebef..69d2d110da3f 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2224,7 +2224,11 @@ size_t fault_in_readable(const char __user *uaddr, size_t size)
/* Stop once we overflow to 0. */
for (cur = start; cur && cur < end; cur = PAGE_ALIGN_DOWN(cur + PAGE_SIZE))
+#if defined(CONFIG_SAFEFETCH) && !defined(SAFEFETCH_PROTECT_PAGES_READABLE)
+ unsafe_get_user_no_dfcache(c, (const char __user *)cur, out);
+#else
unsafe_get_user(c, (const char __user *)cur, out);
+#endif
out:
user_read_access_end();
(void)c;
--
2.25.1
Powered by blists - more mailing lists