Lines Matching refs:sksec
83 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_sock_genattr() local
86 if (sksec->nlbl_secattr != NULL) in selinux_netlbl_sock_genattr()
87 return sksec->nlbl_secattr; in selinux_netlbl_sock_genattr()
92 rc = security_netlbl_sid_to_secattr(sksec->sid, secattr); in selinux_netlbl_sock_genattr()
97 sksec->nlbl_secattr = secattr; in selinux_netlbl_sock_genattr()
114 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_sock_setsid() local
117 if (sksec->nlbl_state != NLBL_REQUIRE) in selinux_netlbl_sock_setsid()
126 sksec->nlbl_state = NLBL_LABELED; in selinux_netlbl_sock_setsid()
129 sksec->nlbl_state = NLBL_REQSKB; in selinux_netlbl_sock_setsid()
262 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_skbuff_setsid() local
263 if (sksec->nlbl_state != NLBL_REQSKB) in selinux_netlbl_skbuff_setsid()
265 secattr = sksec->nlbl_secattr; in selinux_netlbl_skbuff_setsid()
295 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_inet_conn_established() local
300 if (sksec->nlbl_state != NLBL_REQUIRE) in selinux_netlbl_inet_conn_established()
310 sksec->nlbl_state = NLBL_LABELED; in selinux_netlbl_inet_conn_established()
316 sksec->nlbl_state = NLBL_UNSET; in selinux_netlbl_inet_conn_established()
338 sksec->nlbl_state = NLBL_REQSKB; in selinux_netlbl_inet_conn_established()
340 sksec->nlbl_state = NLBL_CONNLABELED; in selinux_netlbl_inet_conn_established()
384 struct sk_security_struct *sksec; in selinux_netlbl_inode_permission() local
393 sksec = sk->sk_security; in selinux_netlbl_inode_permission()
394 if (sksec == NULL || sksec->nlbl_state != NLBL_REQUIRE) in selinux_netlbl_inode_permission()
399 if (likely(sksec->nlbl_state == NLBL_REQUIRE)) in selinux_netlbl_inode_permission()
422 int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec, in selinux_netlbl_sock_rcv_skb() argument
445 switch (sksec->sclass) { in selinux_netlbl_sock_rcv_skb()
456 rc = avc_has_perm(sksec->sid, nlbl_sid, sksec->sclass, perm, ad); in selinux_netlbl_sock_rcv_skb()
484 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_socket_setsockopt() local
488 (sksec->nlbl_state == NLBL_LABELED || in selinux_netlbl_socket_setsockopt()
489 sksec->nlbl_state == NLBL_CONNLABELED)) { in selinux_netlbl_socket_setsockopt()
517 struct sk_security_struct *sksec = sk->sk_security; in selinux_netlbl_socket_connect() local
520 if (sksec->nlbl_state != NLBL_REQSKB && in selinux_netlbl_socket_connect()
521 sksec->nlbl_state != NLBL_CONNLABELED) in selinux_netlbl_socket_connect()
532 sksec->nlbl_state = NLBL_REQSKB; in selinux_netlbl_socket_connect()
543 sksec->nlbl_state = NLBL_CONNLABELED; in selinux_netlbl_socket_connect()