diff options
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/security/security.c b/security/security.c index 9187665a3fdd..4ba6d4cc061f 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -154,29 +154,33 @@ int security_capset(struct cred *new, const struct cred *old, | |||
154 | effective, inheritable, permitted); | 154 | effective, inheritable, permitted); |
155 | } | 155 | } |
156 | 156 | ||
157 | int security_capable(const struct cred *cred, int cap) | 157 | int security_capable(struct user_namespace *ns, const struct cred *cred, |
158 | int cap) | ||
158 | { | 159 | { |
159 | return security_ops->capable(current, cred, cap, SECURITY_CAP_AUDIT); | 160 | return security_ops->capable(current, cred, ns, cap, |
161 | SECURITY_CAP_AUDIT); | ||
160 | } | 162 | } |
161 | 163 | ||
162 | int security_real_capable(struct task_struct *tsk, int cap) | 164 | int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, |
165 | int cap) | ||
163 | { | 166 | { |
164 | const struct cred *cred; | 167 | const struct cred *cred; |
165 | int ret; | 168 | int ret; |
166 | 169 | ||
167 | cred = get_task_cred(tsk); | 170 | cred = get_task_cred(tsk); |
168 | ret = security_ops->capable(tsk, cred, cap, SECURITY_CAP_AUDIT); | 171 | ret = security_ops->capable(tsk, cred, ns, cap, SECURITY_CAP_AUDIT); |
169 | put_cred(cred); | 172 | put_cred(cred); |
170 | return ret; | 173 | return ret; |
171 | } | 174 | } |
172 | 175 | ||
173 | int security_real_capable_noaudit(struct task_struct *tsk, int cap) | 176 | int security_real_capable_noaudit(struct task_struct *tsk, |
177 | struct user_namespace *ns, int cap) | ||
174 | { | 178 | { |
175 | const struct cred *cred; | 179 | const struct cred *cred; |
176 | int ret; | 180 | int ret; |
177 | 181 | ||
178 | cred = get_task_cred(tsk); | 182 | cred = get_task_cred(tsk); |
179 | ret = security_ops->capable(tsk, cred, cap, SECURITY_CAP_NOAUDIT); | 183 | ret = security_ops->capable(tsk, cred, ns, cap, SECURITY_CAP_NOAUDIT); |
180 | put_cred(cred); | 184 | put_cred(cred); |
181 | return ret; | 185 | return ret; |
182 | } | 186 | } |
@@ -514,16 +518,14 @@ int security_inode_permission(struct inode *inode, int mask) | |||
514 | { | 518 | { |
515 | if (unlikely(IS_PRIVATE(inode))) | 519 | if (unlikely(IS_PRIVATE(inode))) |
516 | return 0; | 520 | return 0; |
517 | return security_ops->inode_permission(inode, mask); | 521 | return security_ops->inode_permission(inode, mask, 0); |
518 | } | 522 | } |
519 | 523 | ||
520 | int security_inode_exec_permission(struct inode *inode, unsigned int flags) | 524 | int security_inode_exec_permission(struct inode *inode, unsigned int flags) |
521 | { | 525 | { |
522 | if (unlikely(IS_PRIVATE(inode))) | 526 | if (unlikely(IS_PRIVATE(inode))) |
523 | return 0; | 527 | return 0; |
524 | if (flags) | 528 | return security_ops->inode_permission(inode, MAY_EXEC, flags); |
525 | return -ECHILD; | ||
526 | return security_ops->inode_permission(inode, MAY_EXEC); | ||
527 | } | 529 | } |
528 | 530 | ||
529 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr) | 531 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr) |