Lines Matching refs:sock
28 static inline struct sock *aa_unix_sk(struct unix_sock *u) in aa_unix_sk()
227 u32 request, struct sock *sk, struct path *path) in profile_sk_perm()
254 static int profile_bind_perm(struct aa_profile *profile, struct sock *sk, in profile_bind_perm()
285 static int profile_listen_perm(struct aa_profile *profile, struct sock *sk, in profile_listen_perm()
322 struct sock *sk, in profile_accept_perm()
352 struct sock *sk, int optname, in profile_opt_perm()
389 struct sock *sk, struct path *path, in profile_peer_perm()
447 const char *op, u32 request, struct sock *sk, in aa_unix_label_sk_perm()
462 int aa_unix_sock_perm(const char *op, u32 request, struct socket *sock) in aa_unix_sock_perm() argument
469 request, sock->sk, in aa_unix_sock_perm()
470 is_unix_fs(sock->sk) ? &unix_sk(sock->sk)->path : NULL); in aa_unix_sock_perm()
487 int aa_unix_bind_perm(struct socket *sock, struct sockaddr *addr, in aa_unix_bind_perm() argument
501 DEFINE_AUDIT_SK(ad, OP_BIND, current_cred(), sock->sk); in aa_unix_bind_perm()
507 profile_bind_perm(profile, sock->sk, &ad)); in aa_unix_bind_perm()
527 int aa_unix_listen_perm(struct socket *sock, int backlog) in aa_unix_listen_perm() argument
535 DEFINE_AUDIT_SK(ad, OP_LISTEN, current_cred(), sock->sk); in aa_unix_listen_perm()
538 profile_listen_perm(profile, sock->sk, in aa_unix_listen_perm()
548 int aa_unix_accept_perm(struct socket *sock, struct socket *newsock) in aa_unix_accept_perm() argument
556 DEFINE_AUDIT_SK(ad, OP_ACCEPT, current_cred(), sock->sk); in aa_unix_accept_perm()
559 profile_accept_perm(profile, sock->sk, &ad)); in aa_unix_accept_perm()
580 int aa_unix_opt_perm(const char *op, u32 request, struct socket *sock, in aa_unix_opt_perm() argument
589 DEFINE_AUDIT_SK(ad, op, current_cred(), sock->sk); in aa_unix_opt_perm()
592 profile_opt_perm(profile, request, sock->sk, in aa_unix_opt_perm()
602 struct sock *sk, struct path *path, in unix_peer_perm()
625 struct sock *sk, struct sock *peer_sk, in aa_unix_peer_perm()
646 static void update_sk_ctx(struct sock *sk, struct aa_label *label, in update_sk_ctx()
687 static void update_peer_ctx(struct sock *sk, struct aa_sk_ctx *ctx, in update_peer_ctx()
712 struct socket *sock = (struct socket *) file->private_data; in aa_unix_file_perm() local
716 struct sock *peer_sk = NULL; in aa_unix_file_perm()
723 AA_BUG(!sock); in aa_unix_file_perm()
724 AA_BUG(!sock->sk); in aa_unix_file_perm()
725 AA_BUG(sock->sk->sk_family != PF_UNIX); in aa_unix_file_perm()
731 unix_state_lock(sock->sk); in aa_unix_file_perm()
732 peer_sk = unix_peer(sock->sk); in aa_unix_file_perm()
736 is_sk_fs = is_unix_fs(sock->sk); in aa_unix_file_perm()
737 addr = aa_sunaddr(unix_sk(sock->sk), &addrlen); in aa_unix_file_perm()
738 path = unix_sk(sock->sk)->path; in aa_unix_file_perm()
739 unix_state_unlock(sock->sk); in aa_unix_file_perm()
745 sk_req, sock->sk, in aa_unix_file_perm()
772 MAY_READ | MAY_WRITE, sock->sk, in aa_unix_file_perm()
794 update_sk_ctx(sock->sk, label, plabel); in aa_unix_file_perm()