diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-08 17:48:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-08 17:48:14 -0400 |
commit | 1eccfa090eaea22558570054bbdc147817e1df5e (patch) | |
tree | a0adfdb87319abef88f575ee34314649193b7e92 /include/linux/thread_info.h | |
parent | 1bd4403d86a1c06cb6cc9ac87664a0c9d3413d51 (diff) | |
parent | ed18adc1cdd00a5c55a20fbdaed4804660772281 (diff) |
Merge tag 'usercopy-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull usercopy protection from Kees Cook:
"Tbhis implements HARDENED_USERCOPY verification of copy_to_user and
copy_from_user bounds checking for most architectures on SLAB and
SLUB"
* tag 'usercopy-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
mm: SLUB hardened usercopy support
mm: SLAB hardened usercopy support
s390/uaccess: Enable hardened usercopy
sparc/uaccess: Enable hardened usercopy
powerpc/uaccess: Enable hardened usercopy
ia64/uaccess: Enable hardened usercopy
arm64/uaccess: Enable hardened usercopy
ARM: uaccess: Enable hardened usercopy
x86/uaccess: Enable hardened usercopy
mm: Hardened usercopy
mm: Implement stack frame object validation
mm: Add is_migrate_cma_page
Diffstat (limited to 'include/linux/thread_info.h')
-rw-r--r-- | include/linux/thread_info.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 352b1542f5cc..cbd8990e2e77 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h | |||
@@ -105,6 +105,30 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) | |||
105 | 105 | ||
106 | #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) | 106 | #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) |
107 | 107 | ||
108 | #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES | ||
109 | static inline int arch_within_stack_frames(const void * const stack, | ||
110 | const void * const stackend, | ||
111 | const void *obj, unsigned long len) | ||
112 | { | ||
113 | return 0; | ||
114 | } | ||
115 | #endif | ||
116 | |||
117 | #ifdef CONFIG_HARDENED_USERCOPY | ||
118 | extern void __check_object_size(const void *ptr, unsigned long n, | ||
119 | bool to_user); | ||
120 | |||
121 | static inline void check_object_size(const void *ptr, unsigned long n, | ||
122 | bool to_user) | ||
123 | { | ||
124 | __check_object_size(ptr, n, to_user); | ||
125 | } | ||
126 | #else | ||
127 | static inline void check_object_size(const void *ptr, unsigned long n, | ||
128 | bool to_user) | ||
129 | { } | ||
130 | #endif /* CONFIG_HARDENED_USERCOPY */ | ||
131 | |||
108 | #endif /* __KERNEL__ */ | 132 | #endif /* __KERNEL__ */ |
109 | 133 | ||
110 | #endif /* _LINUX_THREAD_INFO_H */ | 134 | #endif /* _LINUX_THREAD_INFO_H */ |