Lines Matching refs:scm

135 void __scm_destroy(struct scm_cookie *scm)  in __scm_destroy()  argument
137 struct scm_fp_list *fpl = scm->fp; in __scm_destroy()
141 scm->fp = NULL; in __scm_destroy()
150 static inline int scm_replace_pid(struct scm_cookie *scm, struct pid *pid) in scm_replace_pid() argument
155 scm_destroy_cred(scm); in scm_replace_pid()
161 scm->pid = pid; in scm_replace_pid()
162 scm->creds.pid = pid_vnr(pid); in scm_replace_pid()
350 void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) in scm_detach_fds() argument
355 int fdmax = min_t(int, scm_max_fds(msg), scm->fp->count); in scm_detach_fds()
364 scm_detach_fds_compat(msg, scm); in scm_detach_fds()
369 err = scm_recv_one_fd(scm->fp->fp[i], cmsg_data + i, o_flags); in scm_detach_fds()
391 if (i < scm->fp->count || (scm->fp->count && fdmax <= 0)) in scm_detach_fds()
398 __scm_destroy(scm); in scm_detach_fds()
429 static void scm_passec(struct sock *sk, struct msghdr *msg, struct scm_cookie *scm) in scm_passec() argument
435 err = security_secid_to_secctx(scm->secid, &ctx); in scm_passec()
451 static void scm_passec(struct sock *sk, struct msghdr *msg, struct scm_cookie *scm) in scm_passec() argument
461 static void scm_pidfd_recv(struct msghdr *msg, struct scm_cookie *scm) in scm_pidfd_recv() argument
479 if (!scm->pid) in scm_pidfd_recv()
482 pidfd = pidfd_prepare(scm->pid, PIDFD_STALE, &pidfd_file); in scm_pidfd_recv()
498 struct scm_cookie *scm, int flags) in __scm_recv_common() argument
502 scm->fp || scm_has_secdata(sk)) in __scm_recv_common()
505 scm_destroy(scm); in __scm_recv_common()
512 .pid = scm->creds.pid, in __scm_recv_common()
513 .uid = from_kuid_munged(current_ns, scm->creds.uid), in __scm_recv_common()
514 .gid = from_kgid_munged(current_ns, scm->creds.gid), in __scm_recv_common()
520 scm_passec(sk, msg, scm); in __scm_recv_common()
522 if (scm->fp) in __scm_recv_common()
523 scm_detach_fds(msg, scm); in __scm_recv_common()
529 struct scm_cookie *scm, int flags) in scm_recv() argument
531 if (!__scm_recv_common(sock->sk, msg, scm, flags)) in scm_recv()
534 scm_destroy_cred(scm); in scm_recv()
539 struct scm_cookie *scm, int flags) in scm_recv_unix() argument
541 if (!__scm_recv_common(sock->sk, msg, scm, flags)) in scm_recv_unix()
545 scm_pidfd_recv(msg, scm); in scm_recv_unix()
547 scm_destroy_cred(scm); in scm_recv_unix()