Lines Matching refs:sock
1547 struct socket *sock;
1571 sock = SOCKET_I(ip);
1572 if (sock == NULL || sock->sk == NULL)
1575 ssp = sock->sk->sk_security;
1951 struct socket *sock;
1962 sock = SOCKET_I(inode);
1963 ssp = sock->sk->sk_security;
2380 static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
2412 static void smack_sk_free_security(struct sock *sk)
2438 static void smack_sk_clone_security(const struct sock *sk, struct sock *newsk)
2555 static int smack_netlbl_add(struct sock *sk)
2587 static void smack_netlbl_delete(struct sock *sk)
2616 static int smk_ipv4_check(struct sock *sk, struct sockaddr_in *sap)
2685 * @sock: socket
2690 static void smk_ipv6_port_label(struct socket *sock, struct sockaddr *address)
2692 struct sock *sk = sock->sk;
2694 struct socket_smack *ssp = sock->sk->sk_security;
2735 if (spp->smk_port != port || spp->smk_sock_type != sock->type)
2761 spp->smk_sock_type = sock->type;
2778 static int smk_ipv6_port_check(struct sock *sk, struct sockaddr_in6 *address,
2851 struct socket *sock;
2881 sock = SOCKET_I(inode);
2882 if (sock == NULL || sock->sk == NULL)
2885 ssp = sock->sk->sk_security;
2891 if (sock->sk->sk_family == PF_INET) {
2892 rc = smack_netlbl_add(sock->sk);
2902 if (sock->sk->sk_family == PF_INET6)
2903 smk_ipv6_port_label(sock, NULL);
2911 * @sock: the socket
2921 static int smack_socket_post_create(struct socket *sock, int family,
2926 if (sock->sk == NULL)
2933 ssp = sock->sk->sk_security;
2943 return smack_netlbl_add(sock->sk);
2970 * @sock: the socket
2978 static int smack_socket_bind(struct socket *sock, struct sockaddr *address,
2981 if (sock->sk != NULL && sock->sk->sk_family == PF_INET6) {
2985 smk_ipv6_port_label(sock, address);
2993 * @sock: the socket
3001 static int smack_socket_connect(struct socket *sock, struct sockaddr *sap,
3006 if (sock->sk == NULL)
3008 if (sock->sk->sk_family != PF_INET &&
3009 (!IS_ENABLED(CONFIG_IPV6) || sock->sk->sk_family != PF_INET6))
3022 struct socket_smack *ssp = sock->sk->sk_security;
3028 rc = smk_ipv6_port_check(sock->sk, sip, SMK_CONNECTING);
3035 rc = smk_ipv4_check(sock->sk, (struct sockaddr_in *)sap);
3733 * @sock: one sock
3734 * @other: the other sock
3737 * Return 0 if a subject with the smack of sock could access
3740 static int smack_unix_stream_connect(struct sock *sock,
3741 struct sock *other, struct sock *newsk)
3745 struct socket_smack *ssp = sock->sk_security;
3785 * @sock: one socket
3788 * Return 0 if a subject with the smack of sock could access
3791 static int smack_unix_may_send(struct socket *sock, struct socket *other)
3793 struct socket_smack *ssp = sock->sk->sk_security;
3815 * @sock: the socket
3823 static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg,
3831 struct socket_smack *ssp = sock->sk->sk_security;
3842 switch (sock->sk->sk_family) {
3847 rc = smk_ipv4_check(sock->sk, sip);
3861 rc = smk_ipv6_port_check(sock->sk, sap, SMK_SENDING);
4033 static struct smack_known *smack_from_netlbl(const struct sock *sk, u16 family,
4063 static int smack_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
4153 * @sock: the socket
4160 static int smack_socket_getpeersec_stream(struct socket *sock,
4169 ssp = sock->sk->sk_security;
4190 * @sock: the peer socket
4196 static int smack_socket_getpeersec_dgram(struct socket *sock,
4202 struct sock *sk = NULL;
4214 if (family == PF_UNSPEC && sock != NULL)
4215 family = sock->sk->sk_family;
4219 ssp = sock->sk->sk_security;
4231 if (sock != NULL)
4232 sk = sock->sk;
4252 * smack_sock_graft - Initialize a newly created socket with an existing sock
4253 * @sk: child sock
4256 * Set the smk_{in,out} state of an existing sock based on the process that
4259 static void smack_sock_graft(struct sock *sk, struct socket *parent)
4283 static int smack_inet_conn_request(const struct sock *sk, struct sk_buff *skb,
4348 * propagate the wire-label to the sock when it is created.
4371 static void smack_inet_csk_clone(struct sock *sk,