• Home
  • Raw
  • Download

Lines Matching refs:sock

1428 	struct socket *sock;  in smack_inode_getsecurity()  local
1452 sock = SOCKET_I(ip); in smack_inode_getsecurity()
1453 if (sock == NULL || sock->sk == NULL) in smack_inode_getsecurity()
1456 ssp = sock->sk->sk_security; in smack_inode_getsecurity()
1831 struct socket *sock; in smack_file_receive() local
1842 sock = SOCKET_I(inode); in smack_file_receive()
1843 ssp = sock->sk->sk_security; in smack_file_receive()
2261 static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags) in smack_sk_alloc_security()
2293 static void smack_sk_free_security(struct sock *sk) in smack_sk_free_security()
2421 static int smack_netlbl_add(struct sock *sk) in smack_netlbl_add()
2453 static void smack_netlbl_delete(struct sock *sk) in smack_netlbl_delete()
2482 static int smk_ipv4_check(struct sock *sk, struct sockaddr_in *sap) in smk_ipv4_check()
2556 static void smk_ipv6_port_label(struct socket *sock, struct sockaddr *address) in smk_ipv6_port_label() argument
2558 struct sock *sk = sock->sk; in smk_ipv6_port_label()
2560 struct socket_smack *ssp = sock->sk->sk_security; in smk_ipv6_port_label()
2601 if (spp->smk_port != port || spp->smk_sock_type != sock->type) in smk_ipv6_port_label()
2627 spp->smk_sock_type = sock->type; in smk_ipv6_port_label()
2645 static int smk_ipv6_port_check(struct sock *sk, struct sockaddr_in6 *address, in smk_ipv6_port_check()
2717 struct socket *sock; in smack_inode_setsecurity() local
2738 sock = SOCKET_I(inode); in smack_inode_setsecurity()
2739 if (sock == NULL || sock->sk == NULL) in smack_inode_setsecurity()
2742 ssp = sock->sk->sk_security; in smack_inode_setsecurity()
2748 if (sock->sk->sk_family == PF_INET) { in smack_inode_setsecurity()
2749 rc = smack_netlbl_add(sock->sk); in smack_inode_setsecurity()
2759 if (sock->sk->sk_family == PF_INET6) in smack_inode_setsecurity()
2760 smk_ipv6_port_label(sock, NULL); in smack_inode_setsecurity()
2778 static int smack_socket_post_create(struct socket *sock, int family, in smack_socket_post_create() argument
2783 if (sock->sk == NULL) in smack_socket_post_create()
2790 ssp = sock->sk->sk_security; in smack_socket_post_create()
2800 return smack_netlbl_add(sock->sk); in smack_socket_post_create()
2835 static int smack_socket_bind(struct socket *sock, struct sockaddr *address, in smack_socket_bind() argument
2838 if (sock->sk != NULL && sock->sk->sk_family == PF_INET6) { in smack_socket_bind()
2842 smk_ipv6_port_label(sock, address); in smack_socket_bind()
2858 static int smack_socket_connect(struct socket *sock, struct sockaddr *sap, in smack_socket_connect() argument
2863 if (sock->sk == NULL) in smack_socket_connect()
2865 if (sock->sk->sk_family != PF_INET && in smack_socket_connect()
2866 (!IS_ENABLED(CONFIG_IPV6) || sock->sk->sk_family != PF_INET6)) in smack_socket_connect()
2879 struct socket_smack *ssp = sock->sk->sk_security; in smack_socket_connect()
2885 rc = smk_ipv6_port_check(sock->sk, sip, SMK_CONNECTING); in smack_socket_connect()
2891 rc = smk_ipv4_check(sock->sk, (struct sockaddr_in *)sap); in smack_socket_connect()
3602 static int smack_unix_stream_connect(struct sock *sock, in smack_unix_stream_connect() argument
3603 struct sock *other, struct sock *newsk) in smack_unix_stream_connect()
3607 struct socket_smack *ssp = sock->sk_security; in smack_unix_stream_connect()
3653 static int smack_unix_may_send(struct socket *sock, struct socket *other) in smack_unix_may_send() argument
3655 struct socket_smack *ssp = sock->sk->sk_security; in smack_unix_may_send()
3685 static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg, in smack_socket_sendmsg() argument
3693 struct socket_smack *ssp = sock->sk->sk_security; in smack_socket_sendmsg()
3704 switch (sock->sk->sk_family) { in smack_socket_sendmsg()
3709 rc = smk_ipv4_check(sock->sk, sip); in smack_socket_sendmsg()
3723 rc = smk_ipv6_port_check(sock->sk, sap, SMK_SENDING); in smack_socket_sendmsg()
3895 static struct smack_known *smack_from_netlbl(const struct sock *sk, u16 family, in smack_from_netlbl()
3925 static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) in smack_socket_sock_rcv_skb()
4022 static int smack_socket_getpeersec_stream(struct socket *sock, in smack_socket_getpeersec_stream() argument
4031 ssp = sock->sk->sk_security; in smack_socket_getpeersec_stream()
4057 static int smack_socket_getpeersec_dgram(struct socket *sock, in smack_socket_getpeersec_dgram() argument
4063 struct sock *sk = NULL; in smack_socket_getpeersec_dgram()
4075 if (family == PF_UNSPEC && sock != NULL) in smack_socket_getpeersec_dgram()
4076 family = sock->sk->sk_family; in smack_socket_getpeersec_dgram()
4080 ssp = sock->sk->sk_security; in smack_socket_getpeersec_dgram()
4092 if (sock != NULL) in smack_socket_getpeersec_dgram()
4093 sk = sock->sk; in smack_socket_getpeersec_dgram()
4120 static void smack_sock_graft(struct sock *sk, struct socket *parent) in smack_sock_graft()
4144 static int smack_inet_conn_request(const struct sock *sk, struct sk_buff *skb, in smack_inet_conn_request()
4232 static void smack_inet_csk_clone(struct sock *sk, in smack_inet_csk_clone()