[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210514092139.3225509-3-svens@linux.ibm.com>
Date: Fri, 14 May 2021 11:21:39 +0200
From: Sven Schnelle <svens@...ux.ibm.com>
To: Marco Elver <elver@...gle.com>
Cc: linux-kernel@...r.kernel.org, Sven Schnelle <svens@...ux.ibm.com>
Subject: [PATCH 2/2] kfence: only handle kernel mode faults
Signed-off-by: Sven Schnelle <svens@...ux.ibm.com>
---
mm/kfence/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/kfence/core.c b/mm/kfence/core.c
index bc15e3cb71d5..161df492750c 100644
--- a/mm/kfence/core.c
+++ b/mm/kfence/core.c
@@ -813,6 +813,9 @@ bool kfence_handle_page_fault(unsigned long addr, bool is_write, struct pt_regs
enum kfence_error_type error_type;
unsigned long flags;
+ if (user_mode(regs))
+ return false;
+
if (!is_kfence_address((void *)addr))
return false;
--
2.25.1
Powered by blists - more mailing lists