]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - security/selinux/hooks.c
[NetLabel]: add some missing #includes to various header files
[linux-2.6.git] / security / selinux / hooks.c
index 2a6bbb921e1edc1678c30e6b7ab5c321fd2e3455..5a66c4c09f7aa19eadc28341fb62b6851bc020e0 100644 (file)
@@ -281,6 +281,8 @@ static int sk_alloc_security(struct sock *sk, int family, gfp_t priority)
        ssec->sid = SECINITSID_UNLABELED;
        sk->sk_security = ssec;
 
+       selinux_netlbl_sk_security_init(ssec, family);
+
        return 0;
 }
 
@@ -3585,6 +3587,8 @@ static void selinux_sk_clone_security(const struct sock *sk, struct sock *newsk)
 
        newssec->sid = ssec->sid;
        newssec->peer_sid = ssec->peer_sid;
+
+       selinux_netlbl_sk_clone_security(ssec, newssec);
 }
 
 static void selinux_sk_getsecid(struct sock *sk, u32 *secid)
@@ -3598,7 +3602,7 @@ static void selinux_sk_getsecid(struct sock *sk, u32 *secid)
        }
 }
 
-void selinux_sock_graft(struct sock* sk, struct socket *parent)
+static void selinux_sock_graft(struct sock* sk, struct socket *parent)
 {
        struct inode_security_struct *isec = SOCK_INODE(parent)->i_security;
        struct sk_security_struct *sksec = sk->sk_security;
@@ -3608,8 +3612,8 @@ void selinux_sock_graft(struct sock* sk, struct socket *parent)
        selinux_netlbl_sock_graft(sk, parent);
 }
 
-int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
-                                          struct request_sock *req)
+static int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
+                                    struct request_sock *req)
 {
        struct sk_security_struct *sksec = sk->sk_security;
        int err;
@@ -3638,7 +3642,8 @@ int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
        return 0;
 }
 
-void selinux_inet_csk_clone(struct sock *newsk, const struct request_sock *req)
+static void selinux_inet_csk_clone(struct sock *newsk,
+                                  const struct request_sock *req)
 {
        struct sk_security_struct *newsksec = newsk->sk_security;
 
@@ -3647,9 +3652,12 @@ void selinux_inet_csk_clone(struct sock *newsk, const struct request_sock *req)
           new socket in sync, but we don't have the isec available yet.
           So we will wait until sock_graft to do it, by which
           time it will have been created and available. */
+
+       selinux_netlbl_sk_security_init(newsksec, req->rsk_ops->family);
 }
 
-void selinux_req_classify_flow(const struct request_sock *req, struct flowi *fl)
+static void selinux_req_classify_flow(const struct request_sock *req,
+                                     struct flowi *fl)
 {
        fl->secid = req->secid;
 }