summaryrefslogtreecommitdiff
path: root/include/linux/thread_info.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-07-13 02:19:48 +0300
committerKees Cook <keescook@chromium.org>2016-07-27 00:41:47 +0300
commit0f60a8efe4005ab5e65ce000724b04d4ca04a199 (patch)
treea71bc07c426721394f3156318b2220d8f6299c07 /include/linux/thread_info.h
parent7c15d9bb8231f998ae7dc0b72415f5215459f7fb (diff)
downloadlinux-0f60a8efe4005ab5e65ce000724b04d4ca04a199.tar.xz
mm: Implement stack frame object validation
This creates per-architecture function arch_within_stack_frames() that should validate if a given object is contained by a kernel stack frame. Initial implementation is on x86. This is based on code from PaX. Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'include/linux/thread_info.h')
-rw-r--r--include/linux/thread_info.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index b4c2a485b28a..3d5c80b4391d 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -146,6 +146,15 @@ static inline bool test_and_clear_restore_sigmask(void)
#error "no set_restore_sigmask() provided and default one won't work"
#endif
+#ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES
+static inline int arch_within_stack_frames(const void * const stack,
+ const void * const stackend,
+ const void *obj, unsigned long len)
+{
+ return 0;
+}
+#endif
+
#endif /* __KERNEL__ */
#endif /* _LINUX_THREAD_INFO_H */