diff options
author | Stephen Smalley <sds@tycho.nsa.gov> | 2012-11-05 08:15:34 -0500 |
---|---|---|
committer | Brett Rogers <brettrogers11@gmail.com> | 2015-11-07 23:25:20 -0800 |
commit | 361003a3fcdb7bf1dfdf9a009cedbe5eb80ac173 (patch) | |
tree | 7d803557c5445469cceb387573186bb991a08114 /include/linux | |
parent | 8c52c9569370f53294a17d25352cdfa01083af5a (diff) | |
download | kernel_samsung_smdk4412-361003a3fcdb7bf1dfdf9a009cedbe5eb80ac173.zip kernel_samsung_smdk4412-361003a3fcdb7bf1dfdf9a009cedbe5eb80ac173.tar.gz kernel_samsung_smdk4412-361003a3fcdb7bf1dfdf9a009cedbe5eb80ac173.tar.bz2 |
Add security hooks to binder and implement the hooks for SELinux.
Add security hooks to the binder and implement the hooks for SELinux.
The security hooks enable security modules such as SELinux to implement
controls over binder IPC. The security hooks include support for
controlling what process can become the binder context manager
(binder_set_context_mgr), controlling the ability of a process
to invoke a binder transaction/IPC to another process (binder_transaction),
controlling the ability a process to transfer a binder reference to
another process (binder_transfer_binder), and controlling the ability
of a process to transfer an open file to another process (binder_transfer_file).
This support is used by SE Android, http://selinuxproject.org/page/SEAndroid.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Change-Id: I9a64a87825df2e60b9c51400377af4a9cd1c4049
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/security.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index 8ce59ef..8388914 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -1375,6 +1375,11 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) struct security_operations { char name[SECURITY_NAME_MAX + 1]; + int (*binder_set_context_mgr) (struct task_struct *mgr); + int (*binder_transaction) (struct task_struct *from, struct task_struct *to); + int (*binder_transfer_binder) (struct task_struct *from, struct task_struct *to); + int (*binder_transfer_file) (struct task_struct *from, struct task_struct *to, struct file *file); + int (*ptrace_access_check) (struct task_struct *child, unsigned int mode); int (*ptrace_traceme) (struct task_struct *parent); int (*capget) (struct task_struct *target, @@ -1657,6 +1662,10 @@ extern int security_module_enable(struct security_operations *ops); extern int register_security(struct security_operations *ops); /* Security operations */ +int security_binder_set_context_mgr(struct task_struct *mgr); +int security_binder_transaction(struct task_struct *from, struct task_struct *to); +int security_binder_transfer_binder(struct task_struct *from, struct task_struct *to); +int security_binder_transfer_file(struct task_struct *from, struct task_struct *to, struct file *file); int security_ptrace_access_check(struct task_struct *child, unsigned int mode); int security_ptrace_traceme(struct task_struct *parent); int security_capget(struct task_struct *target, @@ -1837,6 +1846,26 @@ static inline int security_init(void) return 0; } +static inline int security_binder_set_context_mgr(struct task_struct *mgr) +{ + return 0; +} + +static inline int security_binder_transaction(struct task_struct *from, struct task_struct *to) +{ + return 0; +} + +static inline int security_binder_transfer_binder(struct task_struct *from, struct task_struct *to) +{ + return 0; +} + +static inline int security_binder_transfer_file(struct task_struct *from, struct task_struct *to, struct file *file) +{ + return 0; +} + static inline int security_ptrace_access_check(struct task_struct *child, unsigned int mode) { |