Lines Matching refs:sk
67 static struct netlbl_lsm_secattr *selinux_netlbl_sock_genattr(struct sock *sk) in selinux_netlbl_sock_genattr() argument
70 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_sock_genattr()
100 const struct sock *sk, in selinux_netlbl_sock_getattr() argument
103 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_sock_getattr()
232 struct sock *sk; in selinux_netlbl_skbuff_setsid() local
236 sk = skb_to_full_sk(skb); in selinux_netlbl_skbuff_setsid()
237 if (sk != NULL) { in selinux_netlbl_skbuff_setsid()
238 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_skbuff_setsid()
242 secattr = selinux_netlbl_sock_getattr(sk, sid); in selinux_netlbl_skbuff_setsid()
276 struct sk_security_struct *sksec = ep->base.sk->sk_security; in selinux_netlbl_sctp_assoc_request()
280 if (ep->base.sk->sk_family != PF_INET && in selinux_netlbl_sctp_assoc_request()
281 ep->base.sk->sk_family != PF_INET6) in selinux_netlbl_sctp_assoc_request()
296 rc = netlbl_conn_setattr(ep->base.sk, (void *)&addr4, &secattr); in selinux_netlbl_sctp_assoc_request()
300 rc = netlbl_conn_setattr(ep->base.sk, (void *)&addr6, &secattr); in selinux_netlbl_sctp_assoc_request()
353 void selinux_netlbl_inet_csk_clone(struct sock *sk, u16 family) in selinux_netlbl_inet_csk_clone() argument
355 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_inet_csk_clone()
371 void selinux_netlbl_sctp_sk_clone(struct sock *sk, struct sock *newsk) in selinux_netlbl_sctp_sk_clone() argument
373 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_sctp_sk_clone()
389 int selinux_netlbl_socket_post_create(struct sock *sk, u16 family) in selinux_netlbl_socket_post_create() argument
392 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_socket_post_create()
398 secattr = selinux_netlbl_sock_genattr(sk); in selinux_netlbl_socket_post_create()
401 rc = netlbl_sock_setattr(sk, family, secattr); in selinux_netlbl_socket_post_create()
506 struct sock *sk = sock->sk; in selinux_netlbl_socket_setsockopt() local
507 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_socket_setsockopt()
514 lock_sock(sk); in selinux_netlbl_socket_setsockopt()
518 rc = netlbl_sock_getattr(sk, &secattr); in selinux_netlbl_socket_setsockopt()
519 release_sock(sk); in selinux_netlbl_socket_setsockopt()
541 static int selinux_netlbl_socket_connect_helper(struct sock *sk, in selinux_netlbl_socket_connect_helper() argument
545 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_socket_connect_helper()
552 netlbl_sock_delattr(sk); in selinux_netlbl_socket_connect_helper()
557 secattr = selinux_netlbl_sock_genattr(sk); in selinux_netlbl_socket_connect_helper()
562 rc = netlbl_conn_setattr(sk, addr, secattr); in selinux_netlbl_socket_connect_helper()
581 int selinux_netlbl_socket_connect_locked(struct sock *sk, in selinux_netlbl_socket_connect_locked() argument
584 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_socket_connect_locked()
590 return selinux_netlbl_socket_connect_helper(sk, addr); in selinux_netlbl_socket_connect_locked()
603 int selinux_netlbl_socket_connect(struct sock *sk, struct sockaddr *addr) in selinux_netlbl_socket_connect() argument
607 lock_sock(sk); in selinux_netlbl_socket_connect()
608 rc = selinux_netlbl_socket_connect_locked(sk, addr); in selinux_netlbl_socket_connect()
609 release_sock(sk); in selinux_netlbl_socket_connect()