diff options
Diffstat (limited to 'include/linux/security.h')
| -rw-r--r-- | include/linux/security.h | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index a22219afff09..b8246a8df7d2 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -74,7 +74,7 @@ extern int cap_file_mmap(struct file *file, unsigned long reqprot, | |||
| 74 | extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); | 74 | extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); |
| 75 | extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, | 75 | extern 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); |
| 77 | extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp); | 77 | extern int cap_task_setscheduler(struct task_struct *p); |
| 78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); | 78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); |
| 79 | extern int cap_task_setnice(struct task_struct *p, int nice); | 79 | extern int cap_task_setnice(struct task_struct *p, int nice); |
| 80 | extern int cap_syslog(int type, bool from_file); | 80 | extern int cap_syslog(int type, bool from_file); |
| @@ -959,6 +959,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. | 959 | * Sets the new child socket's sid to the openreq sid. |
| 960 | * @inet_conn_established: | 960 | * @inet_conn_established: |
| 961 | * Sets the connection's peersid to the secmark on skb. | 961 | * Sets the connection's peersid to the secmark on skb. |
| 962 | * @secmark_relabel_packet: | ||
| 963 | * check if the process should be allowed to relabel packets to the given secid | ||
| 964 | * @security_secmark_refcount_inc | ||
| 965 | * tells the LSM to increment the number of secmark labeling rules loaded | ||
| 966 | * @security_secmark_refcount_dec | ||
| 967 | * tells the LSM to decrement the number of secmark labeling rules loaded | ||
| 962 | * @req_classify_flow: | 968 | * @req_classify_flow: |
| 963 | * Sets the flow's sid to the openreq sid. | 969 | * Sets the flow's sid to the openreq sid. |
| 964 | * @tun_dev_create: | 970 | * @tun_dev_create: |
| @@ -1279,9 +1285,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1279 | * Return 0 if permission is granted. | 1285 | * Return 0 if permission is granted. |
| 1280 | * | 1286 | * |
| 1281 | * @secid_to_secctx: | 1287 | * @secid_to_secctx: |
| 1282 | * Convert secid to security context. | 1288 | * Convert secid to security context. If secdata is NULL the length of |
| 1289 | * the result will be returned in seclen, but no secdata will be returned. | ||
| 1290 | * This does mean that the length could change between calls to check the | ||
| 1291 | * length and the next call which actually allocates and returns the secdata. | ||
| 1283 | * @secid contains the security ID. | 1292 | * @secid contains the security ID. |
| 1284 | * @secdata contains the pointer that stores the converted security context. | 1293 | * @secdata contains the pointer that stores the converted security context. |
| 1294 | * @seclen pointer which contains the length of the data | ||
| 1285 | * @secctx_to_secid: | 1295 | * @secctx_to_secid: |
| 1286 | * Convert security context to secid. | 1296 | * Convert security context to secid. |
| 1287 | * @secid contains the pointer to the generated security ID. | 1297 | * @secid contains the pointer to the generated security ID. |
| @@ -1501,8 +1511,7 @@ struct security_operations { | |||
| 1501 | int (*task_getioprio) (struct task_struct *p); | 1511 | int (*task_getioprio) (struct task_struct *p); |
| 1502 | int (*task_setrlimit) (struct task_struct *p, unsigned int resource, | 1512 | int (*task_setrlimit) (struct task_struct *p, unsigned int resource, |
| 1503 | struct rlimit *new_rlim); | 1513 | struct rlimit *new_rlim); |
| 1504 | int (*task_setscheduler) (struct task_struct *p, int policy, | 1514 | int (*task_setscheduler) (struct task_struct *p); |
| 1505 | struct sched_param *lp); | ||
| 1506 | int (*task_getscheduler) (struct task_struct *p); | 1515 | int (*task_getscheduler) (struct task_struct *p); |
| 1507 | int (*task_movememory) (struct task_struct *p); | 1516 | int (*task_movememory) (struct task_struct *p); |
| 1508 | int (*task_kill) (struct task_struct *p, | 1517 | int (*task_kill) (struct task_struct *p, |
| @@ -1594,6 +1603,9 @@ struct security_operations { | |||
| 1594 | struct request_sock *req); | 1603 | struct request_sock *req); |
| 1595 | void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req); | 1604 | void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req); |
| 1596 | void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb); | 1605 | void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb); |
| 1606 | int (*secmark_relabel_packet) (u32 secid); | ||
| 1607 | void (*secmark_refcount_inc) (void); | ||
| 1608 | void (*secmark_refcount_dec) (void); | ||
| 1597 | void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl); | 1609 | void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl); |
| 1598 | int (*tun_dev_create)(void); | 1610 | int (*tun_dev_create)(void); |
| 1599 | void (*tun_dev_post_create)(struct sock *sk); | 1611 | void (*tun_dev_post_create)(struct sock *sk); |
| @@ -1752,8 +1764,7 @@ int security_task_setioprio(struct task_struct *p, int ioprio); | |||
| 1752 | int security_task_getioprio(struct task_struct *p); | 1764 | int security_task_getioprio(struct task_struct *p); |
| 1753 | int security_task_setrlimit(struct task_struct *p, unsigned int resource, | 1765 | int security_task_setrlimit(struct task_struct *p, unsigned int resource, |
| 1754 | struct rlimit *new_rlim); | 1766 | struct rlimit *new_rlim); |
| 1755 | int security_task_setscheduler(struct task_struct *p, | 1767 | int security_task_setscheduler(struct task_struct *p); |
| 1756 | int policy, struct sched_param *lp); | ||
| 1757 | int security_task_getscheduler(struct task_struct *p); | 1768 | int security_task_getscheduler(struct task_struct *p); |
| 1758 | int security_task_movememory(struct task_struct *p); | 1769 | int security_task_movememory(struct task_struct *p); |
| 1759 | int security_task_kill(struct task_struct *p, struct siginfo *info, | 1770 | int security_task_kill(struct task_struct *p, struct siginfo *info, |
| @@ -2320,11 +2331,9 @@ static inline int security_task_setrlimit(struct task_struct *p, | |||
| 2320 | return 0; | 2331 | return 0; |
| 2321 | } | 2332 | } |
| 2322 | 2333 | ||
| 2323 | static inline int security_task_setscheduler(struct task_struct *p, | 2334 | static inline int security_task_setscheduler(struct task_struct *p) |
| 2324 | int policy, | ||
| 2325 | struct sched_param *lp) | ||
| 2326 | { | 2335 | { |
| 2327 | return cap_task_setscheduler(p, policy, lp); | 2336 | return cap_task_setscheduler(p); |
| 2328 | } | 2337 | } |
| 2329 | 2338 | ||
| 2330 | static inline int security_task_getscheduler(struct task_struct *p) | 2339 | static inline int security_task_getscheduler(struct task_struct *p) |
| @@ -2551,6 +2560,9 @@ void security_inet_csk_clone(struct sock *newsk, | |||
| 2551 | const struct request_sock *req); | 2560 | const struct request_sock *req); |
| 2552 | void security_inet_conn_established(struct sock *sk, | 2561 | void security_inet_conn_established(struct sock *sk, |
| 2553 | struct sk_buff *skb); | 2562 | struct sk_buff *skb); |
| 2563 | int security_secmark_relabel_packet(u32 secid); | ||
| 2564 | void security_secmark_refcount_inc(void); | ||
| 2565 | void security_secmark_refcount_dec(void); | ||
| 2554 | int security_tun_dev_create(void); | 2566 | int security_tun_dev_create(void); |
| 2555 | void security_tun_dev_post_create(struct sock *sk); | 2567 | void security_tun_dev_post_create(struct sock *sk); |
| 2556 | int security_tun_dev_attach(struct sock *sk); | 2568 | int security_tun_dev_attach(struct sock *sk); |
| @@ -2705,6 +2717,19 @@ static inline void security_inet_conn_established(struct sock *sk, | |||
| 2705 | { | 2717 | { |
| 2706 | } | 2718 | } |
| 2707 | 2719 | ||
| 2720 | static inline int security_secmark_relabel_packet(u32 secid) | ||
| 2721 | { | ||
| 2722 | return 0; | ||
| 2723 | } | ||
| 2724 | |||
| 2725 | static inline void security_secmark_refcount_inc(void) | ||
| 2726 | { | ||
| 2727 | } | ||
| 2728 | |||
| 2729 | static inline void security_secmark_refcount_dec(void) | ||
| 2730 | { | ||
| 2731 | } | ||
| 2732 | |||
| 2708 | static inline int security_tun_dev_create(void) | 2733 | static inline int security_tun_dev_create(void) |
| 2709 | { | 2734 | { |
| 2710 | return 0; | 2735 | return 0; |
