diff options
-rw-r--r-- | include/linux/security.h | 7 | ||||
-rw-r--r-- | security/security.c | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index ee969ff40a26..caff54eee686 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1668,6 +1668,8 @@ int security_capset(struct cred *new, const struct cred *old, | |||
1668 | const kernel_cap_t *permitted); | 1668 | const kernel_cap_t *permitted); |
1669 | int security_capable(const struct cred *cred, struct user_namespace *ns, | 1669 | int security_capable(const struct cred *cred, struct user_namespace *ns, |
1670 | int cap); | 1670 | int cap); |
1671 | int security_capable_noaudit(const struct cred *cred, struct user_namespace *ns, | ||
1672 | int cap); | ||
1671 | int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, | 1673 | int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, |
1672 | int cap); | 1674 | int cap); |
1673 | int security_real_capable_noaudit(struct task_struct *tsk, | 1675 | int security_real_capable_noaudit(struct task_struct *tsk, |
@@ -1869,6 +1871,11 @@ static inline int security_capable(const struct cred *cred, | |||
1869 | return cap_capable(cred, ns, cap, SECURITY_CAP_AUDIT); | 1871 | return cap_capable(cred, ns, cap, SECURITY_CAP_AUDIT); |
1870 | } | 1872 | } |
1871 | 1873 | ||
1874 | static inline int security_capable_noaudit(const struct cred *cred, | ||
1875 | struct user_namespace *ns, int cap) { | ||
1876 | return cap_capable(cred, ns, cap, SECURITY_CAP_NOAUDIT); | ||
1877 | } | ||
1878 | |||
1872 | static inline int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, int cap) | 1879 | static inline int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, int cap) |
1873 | { | 1880 | { |
1874 | int ret; | 1881 | int ret; |
diff --git a/security/security.c b/security/security.c index b9e57f4fc44a..b7edaae77d1d 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -160,6 +160,12 @@ int security_capable(const struct cred *cred, struct user_namespace *ns, | |||
160 | return security_ops->capable(cred, ns, cap, SECURITY_CAP_AUDIT); | 160 | return security_ops->capable(cred, ns, cap, SECURITY_CAP_AUDIT); |
161 | } | 161 | } |
162 | 162 | ||
163 | int security_capable_noaudit(const struct cred *cred, struct user_namespace *ns, | ||
164 | int cap) | ||
165 | { | ||
166 | return security_ops->capable(cred, ns, cap, SECURITY_CAP_NOAUDIT); | ||
167 | } | ||
168 | |||
163 | int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, | 169 | int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, |
164 | int cap) | 170 | int cap) |
165 | { | 171 | { |