aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index c13f1cec9abb..5fe28a671cd3 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -37,6 +37,10 @@
37/* Maximum number of letters for an LSM name string */ 37/* Maximum number of letters for an LSM name string */
38#define SECURITY_NAME_MAX 10 38#define SECURITY_NAME_MAX 10
39 39
40/* If capable should audit the security request */
41#define SECURITY_CAP_NOAUDIT 0
42#define SECURITY_CAP_AUDIT 1
43
40struct ctl_table; 44struct ctl_table;
41struct audit_krule; 45struct audit_krule;
42 46
@@ -44,7 +48,7 @@ struct audit_krule;
44 * These functions are in security/capability.c and are used 48 * These functions are in security/capability.c and are used
45 * as the default capabilities functions 49 * as the default capabilities functions
46 */ 50 */
47extern int cap_capable(struct task_struct *tsk, int cap); 51extern int cap_capable(struct task_struct *tsk, int cap, int audit);
48extern int cap_settime(struct timespec *ts, struct timezone *tz); 52extern int cap_settime(struct timespec *ts, struct timezone *tz);
49extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); 53extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode);
50extern int cap_ptrace_traceme(struct task_struct *parent); 54extern int cap_ptrace_traceme(struct task_struct *parent);
@@ -1307,7 +1311,7 @@ struct security_operations {
1307 kernel_cap_t *effective, 1311 kernel_cap_t *effective,
1308 kernel_cap_t *inheritable, 1312 kernel_cap_t *inheritable,
1309 kernel_cap_t *permitted); 1313 kernel_cap_t *permitted);
1310 int (*capable) (struct task_struct *tsk, int cap); 1314 int (*capable) (struct task_struct *tsk, int cap, int audit);
1311 int (*acct) (struct file *file); 1315 int (*acct) (struct file *file);
1312 int (*sysctl) (struct ctl_table *table, int op); 1316 int (*sysctl) (struct ctl_table *table, int op);
1313 int (*quotactl) (int cmds, int type, int id, struct super_block *sb); 1317 int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
@@ -1577,6 +1581,7 @@ void security_capset_set(struct task_struct *target,
1577 kernel_cap_t *inheritable, 1581 kernel_cap_t *inheritable,
1578 kernel_cap_t *permitted); 1582 kernel_cap_t *permitted);
1579int security_capable(struct task_struct *tsk, int cap); 1583int security_capable(struct task_struct *tsk, int cap);
1584int security_capable_noaudit(struct task_struct *tsk, int cap);
1580int security_acct(struct file *file); 1585int security_acct(struct file *file);
1581int security_sysctl(struct ctl_table *table, int op); 1586int security_sysctl(struct ctl_table *table, int op);
1582int security_quotactl(int cmds, int type, int id, struct super_block *sb); 1587int security_quotactl(int cmds, int type, int id, struct super_block *sb);
@@ -1782,7 +1787,12 @@ static inline void security_capset_set(struct task_struct *target,
1782 1787
1783static inline int security_capable(struct task_struct *tsk, int cap) 1788static inline int security_capable(struct task_struct *tsk, int cap)
1784{ 1789{
1785 return cap_capable(tsk, cap); 1790 return cap_capable(tsk, cap, SECURITY_CAP_AUDIT);
1791}
1792
1793static inline int security_capable_noaudit(struct task_struct *tsk, int cap)
1794{
1795 return cap_capable(tsk, cap, SECURITY_CAP_NOAUDIT);
1786} 1796}
1787 1797
1788static inline int security_acct(struct file *file) 1798static inline int security_acct(struct file *file)