aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorPaul Moore <paul.moore@hp.com>2006-08-29 20:53:48 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:18:34 -0400
commit99f59ed073d3c1b890690064ab285a201dea2e35 (patch)
tree0f6ae012cf4f988d3ae0c665fd3b12ea05409ec8 /security/selinux/hooks.c
parentfc747e82b40ea50a62eb2aef55bedd4465607cb0 (diff)
[NetLabel]: Correctly initialize the NetLabel fields.
Fix a problem where the NetLabel specific fields of the sk_security_struct structure were not being initialized early enough in some cases. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 180b26b97d2d..5a66c4c09f7a 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,