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.h54
1 files changed, 39 insertions, 15 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index a22219afff09..fd4d55fb8845 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -74,10 +74,9 @@ extern int cap_file_mmap(struct file *file, unsigned long reqprot,
74extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); 74extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags);
75extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, 75extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
76 unsigned long arg4, unsigned long arg5); 76 unsigned long arg4, unsigned long arg5);
77extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp); 77extern int cap_task_setscheduler(struct task_struct *p);
78extern int cap_task_setioprio(struct task_struct *p, int ioprio); 78extern int cap_task_setioprio(struct task_struct *p, int ioprio);
79extern int cap_task_setnice(struct task_struct *p, int nice); 79extern int cap_task_setnice(struct task_struct *p, int nice);
80extern int cap_syslog(int type, bool from_file);
81extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); 80extern int cap_vm_enough_memory(struct mm_struct *mm, long pages);
82 81
83struct msghdr; 82struct msghdr;
@@ -959,6 +958,12 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
959 * Sets the new child socket's sid to the openreq sid. 958 * Sets the new child socket's sid to the openreq sid.
960 * @inet_conn_established: 959 * @inet_conn_established:
961 * Sets the connection's peersid to the secmark on skb. 960 * Sets the connection's peersid to the secmark on skb.
961 * @secmark_relabel_packet:
962 * check if the process should be allowed to relabel packets to the given secid
963 * @security_secmark_refcount_inc
964 * tells the LSM to increment the number of secmark labeling rules loaded
965 * @security_secmark_refcount_dec
966 * tells the LSM to decrement the number of secmark labeling rules loaded
962 * @req_classify_flow: 967 * @req_classify_flow:
963 * Sets the flow's sid to the openreq sid. 968 * Sets the flow's sid to the openreq sid.
964 * @tun_dev_create: 969 * @tun_dev_create:
@@ -1279,9 +1284,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1279 * Return 0 if permission is granted. 1284 * Return 0 if permission is granted.
1280 * 1285 *
1281 * @secid_to_secctx: 1286 * @secid_to_secctx:
1282 * Convert secid to security context. 1287 * Convert secid to security context. If secdata is NULL the length of
1288 * the result will be returned in seclen, but no secdata will be returned.
1289 * This does mean that the length could change between calls to check the
1290 * length and the next call which actually allocates and returns the secdata.
1283 * @secid contains the security ID. 1291 * @secid contains the security ID.
1284 * @secdata contains the pointer that stores the converted security context. 1292 * @secdata contains the pointer that stores the converted security context.
1293 * @seclen pointer which contains the length of the data
1285 * @secctx_to_secid: 1294 * @secctx_to_secid:
1286 * Convert security context to secid. 1295 * Convert security context to secid.
1287 * @secid contains the pointer to the generated security ID. 1296 * @secid contains the pointer to the generated security ID.
@@ -1378,7 +1387,7 @@ struct security_operations {
1378 int (*sysctl) (struct ctl_table *table, int op); 1387 int (*sysctl) (struct ctl_table *table, int op);
1379 int (*quotactl) (int cmds, int type, int id, struct super_block *sb); 1388 int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
1380 int (*quota_on) (struct dentry *dentry); 1389 int (*quota_on) (struct dentry *dentry);
1381 int (*syslog) (int type, bool from_file); 1390 int (*syslog) (int type);
1382 int (*settime) (struct timespec *ts, struct timezone *tz); 1391 int (*settime) (struct timespec *ts, struct timezone *tz);
1383 int (*vm_enough_memory) (struct mm_struct *mm, long pages); 1392 int (*vm_enough_memory) (struct mm_struct *mm, long pages);
1384 1393
@@ -1501,8 +1510,7 @@ struct security_operations {
1501 int (*task_getioprio) (struct task_struct *p); 1510 int (*task_getioprio) (struct task_struct *p);
1502 int (*task_setrlimit) (struct task_struct *p, unsigned int resource, 1511 int (*task_setrlimit) (struct task_struct *p, unsigned int resource,
1503 struct rlimit *new_rlim); 1512 struct rlimit *new_rlim);
1504 int (*task_setscheduler) (struct task_struct *p, int policy, 1513 int (*task_setscheduler) (struct task_struct *p);
1505 struct sched_param *lp);
1506 int (*task_getscheduler) (struct task_struct *p); 1514 int (*task_getscheduler) (struct task_struct *p);
1507 int (*task_movememory) (struct task_struct *p); 1515 int (*task_movememory) (struct task_struct *p);
1508 int (*task_kill) (struct task_struct *p, 1516 int (*task_kill) (struct task_struct *p,
@@ -1594,6 +1602,9 @@ struct security_operations {
1594 struct request_sock *req); 1602 struct request_sock *req);
1595 void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req); 1603 void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req);
1596 void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb); 1604 void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb);
1605 int (*secmark_relabel_packet) (u32 secid);
1606 void (*secmark_refcount_inc) (void);
1607 void (*secmark_refcount_dec) (void);
1597 void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl); 1608 void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl);
1598 int (*tun_dev_create)(void); 1609 int (*tun_dev_create)(void);
1599 void (*tun_dev_post_create)(struct sock *sk); 1610 void (*tun_dev_post_create)(struct sock *sk);
@@ -1659,7 +1670,7 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap);
1659int security_sysctl(struct ctl_table *table, int op); 1670int security_sysctl(struct ctl_table *table, int op);
1660int security_quotactl(int cmds, int type, int id, struct super_block *sb); 1671int security_quotactl(int cmds, int type, int id, struct super_block *sb);
1661int security_quota_on(struct dentry *dentry); 1672int security_quota_on(struct dentry *dentry);
1662int security_syslog(int type, bool from_file); 1673int security_syslog(int type);
1663int security_settime(struct timespec *ts, struct timezone *tz); 1674int security_settime(struct timespec *ts, struct timezone *tz);
1664int security_vm_enough_memory(long pages); 1675int security_vm_enough_memory(long pages);
1665int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); 1676int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
@@ -1752,8 +1763,7 @@ int security_task_setioprio(struct task_struct *p, int ioprio);
1752int security_task_getioprio(struct task_struct *p); 1763int security_task_getioprio(struct task_struct *p);
1753int security_task_setrlimit(struct task_struct *p, unsigned int resource, 1764int security_task_setrlimit(struct task_struct *p, unsigned int resource,
1754 struct rlimit *new_rlim); 1765 struct rlimit *new_rlim);
1755int security_task_setscheduler(struct task_struct *p, 1766int security_task_setscheduler(struct task_struct *p);
1756 int policy, struct sched_param *lp);
1757int security_task_getscheduler(struct task_struct *p); 1767int security_task_getscheduler(struct task_struct *p);
1758int security_task_movememory(struct task_struct *p); 1768int security_task_movememory(struct task_struct *p);
1759int security_task_kill(struct task_struct *p, struct siginfo *info, 1769int security_task_kill(struct task_struct *p, struct siginfo *info,
@@ -1890,9 +1900,9 @@ static inline int security_quota_on(struct dentry *dentry)
1890 return 0; 1900 return 0;
1891} 1901}
1892 1902
1893static inline int security_syslog(int type, bool from_file) 1903static inline int security_syslog(int type)
1894{ 1904{
1895 return cap_syslog(type, from_file); 1905 return 0;
1896} 1906}
1897 1907
1898static inline int security_settime(struct timespec *ts, struct timezone *tz) 1908static inline int security_settime(struct timespec *ts, struct timezone *tz)
@@ -2320,11 +2330,9 @@ static inline int security_task_setrlimit(struct task_struct *p,
2320 return 0; 2330 return 0;
2321} 2331}
2322 2332
2323static inline int security_task_setscheduler(struct task_struct *p, 2333static inline int security_task_setscheduler(struct task_struct *p)
2324 int policy,
2325 struct sched_param *lp)
2326{ 2334{
2327 return cap_task_setscheduler(p, policy, lp); 2335 return cap_task_setscheduler(p);
2328} 2336}
2329 2337
2330static inline int security_task_getscheduler(struct task_struct *p) 2338static inline int security_task_getscheduler(struct task_struct *p)
@@ -2551,6 +2559,9 @@ void security_inet_csk_clone(struct sock *newsk,
2551 const struct request_sock *req); 2559 const struct request_sock *req);
2552void security_inet_conn_established(struct sock *sk, 2560void security_inet_conn_established(struct sock *sk,
2553 struct sk_buff *skb); 2561 struct sk_buff *skb);
2562int security_secmark_relabel_packet(u32 secid);
2563void security_secmark_refcount_inc(void);
2564void security_secmark_refcount_dec(void);
2554int security_tun_dev_create(void); 2565int security_tun_dev_create(void);
2555void security_tun_dev_post_create(struct sock *sk); 2566void security_tun_dev_post_create(struct sock *sk);
2556int security_tun_dev_attach(struct sock *sk); 2567int security_tun_dev_attach(struct sock *sk);
@@ -2705,6 +2716,19 @@ static inline void security_inet_conn_established(struct sock *sk,
2705{ 2716{
2706} 2717}
2707 2718
2719static inline int security_secmark_relabel_packet(u32 secid)
2720{
2721 return 0;
2722}
2723
2724static inline void security_secmark_refcount_inc(void)
2725{
2726}
2727
2728static inline void security_secmark_refcount_dec(void)
2729{
2730}
2731
2708static inline int security_tun_dev_create(void) 2732static inline int security_tun_dev_create(void)
2709{ 2733{
2710 return 0; 2734 return 0;