aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 180b26b97d2..5a66c4c09f7 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -281,6 +281,8 @@ static int sk_alloc_security(struct sock *sk, int family, gfp_t priority)
281 ssec->sid = SECINITSID_UNLABELED; 281 ssec->sid = SECINITSID_UNLABELED;
282 sk->sk_security = ssec; 282 sk->sk_security = ssec;
283 283
284 selinux_netlbl_sk_security_init(ssec, family);
285
284 return 0; 286 return 0;
285} 287}
286 288
@@ -3585,6 +3587,8 @@ static void selinux_sk_clone_security(const struct sock *sk, struct sock *newsk)
3585 3587
3586 newssec->sid = ssec->sid; 3588 newssec->sid = ssec->sid;
3587 newssec->peer_sid = ssec->peer_sid; 3589 newssec->peer_sid = ssec->peer_sid;
3590
3591 selinux_netlbl_sk_clone_security(ssec, newssec);
3588} 3592}
3589 3593
3590static void selinux_sk_getsecid(struct sock *sk, u32 *secid) 3594static void selinux_sk_getsecid(struct sock *sk, u32 *secid)
@@ -3648,6 +3652,8 @@ static void selinux_inet_csk_clone(struct sock *newsk,
3648 new socket in sync, but we don't have the isec available yet. 3652 new socket in sync, but we don't have the isec available yet.
3649 So we will wait until sock_graft to do it, by which 3653 So we will wait until sock_graft to do it, by which
3650 time it will have been created and available. */ 3654 time it will have been created and available. */
3655
3656 selinux_netlbl_sk_security_init(newsksec, req->rsk_ops->family);
3651} 3657}
3652 3658
3653static void selinux_req_classify_flow(const struct request_sock *req, 3659static void selinux_req_classify_flow(const struct request_sock *req,