aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2012-09-04 16:32:13 -0400
committerJames Morris <james.l.morris@oracle.com>2012-09-05 17:12:31 -0400
commitc6993e4ac002c92bc75379212e9179c36d4bf7ee (patch)
treecdb4c800ea3cf4003b07087166cc767dab79032f /include/linux/security.h
parent81198078d7da4240f3cbfc2c6a8ea6cd417f51a7 (diff)
security: allow Yama to be unconditionally stacked
Unconditionally call Yama when CONFIG_SECURITY_YAMA_STACKED is selected, no matter what LSM module is primary. Ubuntu and Chrome OS already carry patches to do this, and Fedora has voiced interest in doing this as well. Instead of having multiple distributions (or LSM authors) carrying these patches, just allow Yama to be called unconditionally when selected by the new CONFIG. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Serge E. Hallyn <serge.hallyn@canonical.com> Acked-by: Eric Paris <eparis@redhat.com> Acked-by: John Johansen <john.johansen@canonical.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index 3dea6a9d568f..01ef030b9409 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -3021,5 +3021,36 @@ static inline void free_secdata(void *secdata)
3021{ } 3021{ }
3022#endif /* CONFIG_SECURITY */ 3022#endif /* CONFIG_SECURITY */
3023 3023
3024#ifdef CONFIG_SECURITY_YAMA
3025extern int yama_ptrace_access_check(struct task_struct *child,
3026 unsigned int mode);
3027extern int yama_ptrace_traceme(struct task_struct *parent);
3028extern void yama_task_free(struct task_struct *task);
3029extern int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
3030 unsigned long arg4, unsigned long arg5);
3031#else
3032static inline int yama_ptrace_access_check(struct task_struct *child,
3033 unsigned int mode)
3034{
3035 return 0;
3036}
3037
3038static inline int yama_ptrace_traceme(struct task_struct *parent)
3039{
3040 return 0;
3041}
3042
3043static inline void yama_task_free(struct task_struct *task)
3044{
3045}
3046
3047static inline int yama_task_prctl(int option, unsigned long arg2,
3048 unsigned long arg3, unsigned long arg4,
3049 unsigned long arg5)
3050{
3051 return -ENOSYS;
3052}
3053#endif /* CONFIG_SECURITY_YAMA */
3054
3024#endif /* ! __LINUX_SECURITY_H */ 3055#endif /* ! __LINUX_SECURITY_H */
3025 3056