diff --git a/fs/exec.c b/fs/exec.c
index 1b1d946..c9a5bc9 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2075,6 +2075,24 @@ static __noreturn void pax_report_usercopy(const void *ptr, unsigned long len, b
 }
 #endif
 
+#ifdef CONFIG_PAX_USERCOPY
+static inline bool check_kernel_text_object(unsigned long low, unsigned long high)
+{
+#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
+	unsigned long textlow = ktla_ktva((unsigned long)_stext);
+	unsigned long texthigh = ktla_ktva((unsigned long)_etext);
+#else
+	unsigned long textlow = _stext;
+	unsigned long texthigh = _etext;	
+#endif
+
+	if (high < textlow || low > texthigh)
+		return false;
+	else
+		return true;
+}
+#endif
+
 void __check_object_size(const void *ptr, unsigned long n, bool to_user)
 {
 
@@ -2086,9 +2104,16 @@ void __check_object_size(const void *ptr, unsigned long n, bool to_user)
 
 	type = check_heap_object(ptr, n);
 	if (!type) {
-		if (check_stack_object(ptr, n) != -1)
+		int ret = check_stack_object(ptr, n);
+		if (ret == 1 || ret == 2)
 			return;
-		type = "<process stack>";
+		if (ret == 0) {
+			if (check_kernel_text_object((unsigned long)ptr, (unsigned long)ptr + n))
+				type = "<kernel text>";
+			else
+				return;
+		} else
+			type = "<process stack>";
 	}
 
 	pax_report_usercopy(ptr, n, to_user, type);
