aboutsummaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c58
1 files changed, 27 insertions, 31 deletions
diff --git a/security/security.c b/security/security.c
index f40a0a04c3c2..a55d739c6864 100644
--- a/security/security.c
+++ b/security/security.c
@@ -145,18 +145,13 @@ int security_capget(struct task_struct *target,
145 return security_ops->capget(target, effective, inheritable, permitted); 145 return security_ops->capget(target, effective, inheritable, permitted);
146} 146}
147 147
148int security_capset_check(const kernel_cap_t *effective, 148int security_capset(struct cred *new, const struct cred *old,
149 const kernel_cap_t *inheritable, 149 const kernel_cap_t *effective,
150 const kernel_cap_t *permitted) 150 const kernel_cap_t *inheritable,
151 const kernel_cap_t *permitted)
151{ 152{
152 return security_ops->capset_check(effective, inheritable, permitted); 153 return security_ops->capset(new, old,
153} 154 effective, inheritable, permitted);
154
155void security_capset_set(const kernel_cap_t *effective,
156 const kernel_cap_t *inheritable,
157 const kernel_cap_t *permitted)
158{
159 security_ops->capset_set(effective, inheritable, permitted);
160} 155}
161 156
162int security_capable(struct task_struct *tsk, int cap) 157int security_capable(struct task_struct *tsk, int cap)
@@ -228,9 +223,9 @@ void security_bprm_free(struct linux_binprm *bprm)
228 security_ops->bprm_free_security(bprm); 223 security_ops->bprm_free_security(bprm);
229} 224}
230 225
231void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe) 226int security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe)
232{ 227{
233 security_ops->bprm_apply_creds(bprm, unsafe); 228 return security_ops->bprm_apply_creds(bprm, unsafe);
234} 229}
235 230
236void security_bprm_post_apply_creds(struct linux_binprm *bprm) 231void security_bprm_post_apply_creds(struct linux_binprm *bprm)
@@ -616,14 +611,19 @@ int security_task_create(unsigned long clone_flags)
616 return security_ops->task_create(clone_flags); 611 return security_ops->task_create(clone_flags);
617} 612}
618 613
619int security_cred_alloc(struct cred *cred) 614void security_cred_free(struct cred *cred)
620{ 615{
621 return security_ops->cred_alloc_security(cred); 616 security_ops->cred_free(cred);
622} 617}
623 618
624void security_cred_free(struct cred *cred) 619int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp)
625{ 620{
626 security_ops->cred_free(cred); 621 return security_ops->cred_prepare(new, old, gfp);
622}
623
624void security_commit_creds(struct cred *new, const struct cred *old)
625{
626 return security_ops->cred_commit(new, old);
627} 627}
628 628
629int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags) 629int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags)
@@ -631,10 +631,10 @@ int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags)
631 return security_ops->task_setuid(id0, id1, id2, flags); 631 return security_ops->task_setuid(id0, id1, id2, flags);
632} 632}
633 633
634int security_task_post_setuid(uid_t old_ruid, uid_t old_euid, 634int security_task_fix_setuid(struct cred *new, const struct cred *old,
635 uid_t old_suid, int flags) 635 int flags)
636{ 636{
637 return security_ops->task_post_setuid(old_ruid, old_euid, old_suid, flags); 637 return security_ops->task_fix_setuid(new, old, flags);
638} 638}
639 639
640int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags) 640int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags)
@@ -716,14 +716,9 @@ int security_task_wait(struct task_struct *p)
716} 716}
717 717
718int security_task_prctl(int option, unsigned long arg2, unsigned long arg3, 718int security_task_prctl(int option, unsigned long arg2, unsigned long arg3,
719 unsigned long arg4, unsigned long arg5, long *rc_p) 719 unsigned long arg4, unsigned long arg5)
720{
721 return security_ops->task_prctl(option, arg2, arg3, arg4, arg5, rc_p);
722}
723
724void security_task_reparent_to_init(struct task_struct *p)
725{ 720{
726 security_ops->task_reparent_to_init(p); 721 return security_ops->task_prctl(option, arg2, arg3, arg4, arg5);
727} 722}
728 723
729void security_task_to_inode(struct task_struct *p, struct inode *inode) 724void security_task_to_inode(struct task_struct *p, struct inode *inode)
@@ -1123,9 +1118,10 @@ EXPORT_SYMBOL(security_skb_classify_flow);
1123 1118
1124#ifdef CONFIG_KEYS 1119#ifdef CONFIG_KEYS
1125 1120
1126int security_key_alloc(struct key *key, struct task_struct *tsk, unsigned long flags) 1121int security_key_alloc(struct key *key, const struct cred *cred,
1122 unsigned long flags)
1127{ 1123{
1128 return security_ops->key_alloc(key, tsk, flags); 1124 return security_ops->key_alloc(key, cred, flags);
1129} 1125}
1130 1126
1131void security_key_free(struct key *key) 1127void security_key_free(struct key *key)
@@ -1134,9 +1130,9 @@ void security_key_free(struct key *key)
1134} 1130}
1135 1131
1136int security_key_permission(key_ref_t key_ref, 1132int security_key_permission(key_ref_t key_ref,
1137 struct task_struct *context, key_perm_t perm) 1133 const struct cred *cred, key_perm_t perm)
1138{ 1134{
1139 return security_ops->key_permission(key_ref, context, perm); 1135 return security_ops->key_permission(key_ref, cred, perm);
1140} 1136}
1141 1137
1142int security_key_getsecurity(struct key *key, char **_buffer) 1138int security_key_getsecurity(struct key *key, char **_buffer)