Lines Matching refs:scm
262 static void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb) in unix_get_secdata() argument
264 UNIXCB(skb).secid = scm->secid; in unix_get_secdata()
267 static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb) in unix_set_secdata() argument
269 scm->secid = UNIXCB(skb).secid; in unix_set_secdata()
272 static inline bool unix_secdata_eq(struct scm_cookie *scm, struct sk_buff *skb) in unix_secdata_eq() argument
274 return (scm->secid == UNIXCB(skb).secid); in unix_secdata_eq()
277 static inline void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb) in unix_get_secdata() argument
280 static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb) in unix_set_secdata() argument
283 static inline bool unix_secdata_eq(struct scm_cookie *scm, struct sk_buff *skb) in unix_secdata_eq() argument
1845 static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb) in unix_attach_fds() argument
1850 UNIXCB(skb).fp = scm->fp; in unix_attach_fds()
1851 scm->fp = NULL; in unix_attach_fds()
1859 static void unix_detach_fds(struct scm_cookie *scm, struct sk_buff *skb) in unix_detach_fds() argument
1861 scm->fp = UNIXCB(skb).fp; in unix_detach_fds()
1864 unix_destroy_fpl(scm->fp); in unix_detach_fds()
1867 static void unix_peek_fds(struct scm_cookie *scm, struct sk_buff *skb) in unix_peek_fds() argument
1869 scm->fp = scm_fp_dup(UNIXCB(skb).fp); in unix_peek_fds()
1874 struct scm_cookie scm; in unix_destruct_scm() local
1876 memset(&scm, 0, sizeof(scm)); in unix_destruct_scm()
1877 scm.pid = UNIXCB(skb).pid; in unix_destruct_scm()
1879 unix_detach_fds(&scm, skb); in unix_destruct_scm()
1883 scm_destroy(&scm); in unix_destruct_scm()
1887 static int unix_scm_to_skb(struct scm_cookie *scm, struct sk_buff *skb, bool send_fds) in unix_scm_to_skb() argument
1891 UNIXCB(skb).pid = get_pid(scm->pid); in unix_scm_to_skb()
1892 UNIXCB(skb).uid = scm->creds.uid; in unix_scm_to_skb()
1893 UNIXCB(skb).gid = scm->creds.gid; in unix_scm_to_skb()
1895 unix_get_secdata(scm, skb); in unix_scm_to_skb()
1896 if (scm->fp && send_fds) in unix_scm_to_skb()
1897 err = unix_attach_fds(scm, skb); in unix_scm_to_skb()
1930 struct scm_cookie *scm) in unix_skb_scm_eq() argument
1932 return UNIXCB(skb).pid == scm->pid && in unix_skb_scm_eq()
1933 uid_eq(UNIXCB(skb).uid, scm->creds.uid) && in unix_skb_scm_eq()
1934 gid_eq(UNIXCB(skb).gid, scm->creds.gid) && in unix_skb_scm_eq()
1935 unix_secdata_eq(scm, skb); in unix_skb_scm_eq()
1970 struct scm_cookie scm; in unix_dgram_sendmsg() local
1977 err = scm_send(sock, msg, &scm, false); in unix_dgram_sendmsg()
1981 wait_for_unix_gc(scm.fp); in unix_dgram_sendmsg()
2033 err = unix_scm_to_skb(&scm, skb, true); in unix_dgram_sendmsg()
2169 scm_destroy(&scm); in unix_dgram_sendmsg()
2181 scm_destroy(&scm); in unix_dgram_sendmsg()
2192 struct scm_cookie *scm, bool fds_sent) in queue_oob() argument
2203 err = unix_scm_to_skb(scm, skb, !fds_sent); in queue_oob()
2249 struct scm_cookie scm; in unix_stream_sendmsg() local
2253 err = scm_send(sock, msg, &scm, false); in unix_stream_sendmsg()
2257 wait_for_unix_gc(scm.fp); in unix_stream_sendmsg()
2308 err = unix_scm_to_skb(&scm, skb, !fds_sent); in unix_stream_sendmsg()
2351 err = queue_oob(sock, msg, other, &scm, fds_sent); in unix_stream_sendmsg()
2358 scm_destroy(&scm); in unix_stream_sendmsg()
2370 scm_destroy(&scm); in unix_stream_sendmsg()
2417 struct scm_cookie scm; in __unix_dgram_recvmsg() local
2486 memset(&scm, 0, sizeof(scm)); in __unix_dgram_recvmsg()
2488 scm_set_cred(&scm, UNIXCB(skb).pid, UNIXCB(skb).uid, UNIXCB(skb).gid); in __unix_dgram_recvmsg()
2489 unix_set_secdata(&scm, skb); in __unix_dgram_recvmsg()
2493 unix_detach_fds(&scm, skb); in __unix_dgram_recvmsg()
2513 unix_peek_fds(&scm, skb); in __unix_dgram_recvmsg()
2517 scm_recv_unix(sock, msg, &scm, flags); in __unix_dgram_recvmsg()
2756 struct scm_cookie scm; in unix_stream_read_generic() local
2787 memset(&scm, 0, sizeof(scm)); in unix_stream_read_generic()
2846 scm_destroy(&scm); in unix_stream_read_generic()
2870 if (!unix_skb_scm_eq(skb, &scm)) in unix_stream_read_generic()
2875 scm_set_cred(&scm, UNIXCB(skb).pid, UNIXCB(skb).uid, UNIXCB(skb).gid); in unix_stream_read_generic()
2876 unix_set_secdata(&scm, skb); in unix_stream_read_generic()
2911 unix_detach_fds(&scm, skb); in unix_stream_read_generic()
2920 if (scm.fp) in unix_stream_read_generic()
2926 unix_peek_fds(&scm, skb); in unix_stream_read_generic()
2947 scm_recv_unix(sock, state->msg, &scm, flags); in unix_stream_read_generic()
2949 scm_destroy(&scm); in unix_stream_read_generic()