diff options
Diffstat (limited to 'security/selinux/hooks.c')
| -rw-r--r-- | security/selinux/hooks.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 4796ddd4e721..d9154cf90ae1 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
| @@ -3354,11 +3354,11 @@ static int selinux_task_setrlimit(struct task_struct *p, unsigned int resource, | |||
| 3354 | return 0; | 3354 | return 0; |
| 3355 | } | 3355 | } |
| 3356 | 3356 | ||
| 3357 | static int selinux_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp) | 3357 | static int selinux_task_setscheduler(struct task_struct *p) |
| 3358 | { | 3358 | { |
| 3359 | int rc; | 3359 | int rc; |
| 3360 | 3360 | ||
| 3361 | rc = cap_task_setscheduler(p, policy, lp); | 3361 | rc = cap_task_setscheduler(p); |
| 3362 | if (rc) | 3362 | if (rc) |
| 3363 | return rc; | 3363 | return rc; |
| 3364 | 3364 | ||
| @@ -4279,6 +4279,27 @@ static void selinux_inet_conn_established(struct sock *sk, struct sk_buff *skb) | |||
| 4279 | selinux_skb_peerlbl_sid(skb, family, &sksec->peer_sid); | 4279 | selinux_skb_peerlbl_sid(skb, family, &sksec->peer_sid); |
| 4280 | } | 4280 | } |
| 4281 | 4281 | ||
| 4282 | static int selinux_secmark_relabel_packet(u32 sid) | ||
| 4283 | { | ||
| 4284 | const struct task_security_struct *__tsec; | ||
| 4285 | u32 tsid; | ||
| 4286 | |||
| 4287 | __tsec = current_security(); | ||
| 4288 | tsid = __tsec->sid; | ||
| 4289 | |||
| 4290 | return avc_has_perm(tsid, sid, SECCLASS_PACKET, PACKET__RELABELTO, NULL); | ||
| 4291 | } | ||
| 4292 | |||
| 4293 | static void selinux_secmark_refcount_inc(void) | ||
| 4294 | { | ||
| 4295 | atomic_inc(&selinux_secmark_refcount); | ||
| 4296 | } | ||
| 4297 | |||
| 4298 | static void selinux_secmark_refcount_dec(void) | ||
| 4299 | { | ||
| 4300 | atomic_dec(&selinux_secmark_refcount); | ||
| 4301 | } | ||
| 4302 | |||
| 4282 | static void selinux_req_classify_flow(const struct request_sock *req, | 4303 | static void selinux_req_classify_flow(const struct request_sock *req, |
| 4283 | struct flowi *fl) | 4304 | struct flowi *fl) |
| 4284 | { | 4305 | { |
| @@ -5533,6 +5554,9 @@ static struct security_operations selinux_ops = { | |||
| 5533 | .inet_conn_request = selinux_inet_conn_request, | 5554 | .inet_conn_request = selinux_inet_conn_request, |
| 5534 | .inet_csk_clone = selinux_inet_csk_clone, | 5555 | .inet_csk_clone = selinux_inet_csk_clone, |
| 5535 | .inet_conn_established = selinux_inet_conn_established, | 5556 | .inet_conn_established = selinux_inet_conn_established, |
| 5557 | .secmark_relabel_packet = selinux_secmark_relabel_packet, | ||
| 5558 | .secmark_refcount_inc = selinux_secmark_refcount_inc, | ||
| 5559 | .secmark_refcount_dec = selinux_secmark_refcount_dec, | ||
| 5536 | .req_classify_flow = selinux_req_classify_flow, | 5560 | .req_classify_flow = selinux_req_classify_flow, |
| 5537 | .tun_dev_create = selinux_tun_dev_create, | 5561 | .tun_dev_create = selinux_tun_dev_create, |
| 5538 | .tun_dev_post_create = selinux_tun_dev_post_create, | 5562 | .tun_dev_post_create = selinux_tun_dev_post_create, |
