Lines Matching refs:kmsg

34 int get_compat_msghdr(struct msghdr *kmsg,  in get_compat_msghdr()  argument
45 __get_user(kmsg->msg_namelen, &umsg->msg_namelen) || in get_compat_msghdr()
49 __get_user(kmsg->msg_controllen, &umsg->msg_controllen) || in get_compat_msghdr()
50 __get_user(kmsg->msg_flags, &umsg->msg_flags)) in get_compat_msghdr()
54 kmsg->msg_namelen = 0; in get_compat_msghdr()
56 if (kmsg->msg_namelen < 0) in get_compat_msghdr()
59 if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) in get_compat_msghdr()
60 kmsg->msg_namelen = sizeof(struct sockaddr_storage); in get_compat_msghdr()
61 kmsg->msg_control = compat_ptr(tmp3); in get_compat_msghdr()
66 if (uaddr && kmsg->msg_namelen) { in get_compat_msghdr()
69 kmsg->msg_namelen, in get_compat_msghdr()
70 kmsg->msg_name); in get_compat_msghdr()
75 kmsg->msg_name = NULL; in get_compat_msghdr()
76 kmsg->msg_namelen = 0; in get_compat_msghdr()
82 kmsg->msg_iocb = NULL; in get_compat_msghdr()
86 UIO_FASTIOV, iov, &kmsg->msg_iter); in get_compat_msghdr()
124 int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, in cmsghdr_from_user_compat_to_kern() argument
135 ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); in cmsghdr_from_user_compat_to_kern()
141 if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
148 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); in cmsghdr_from_user_compat_to_kern()
165 ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); in cmsghdr_from_user_compat_to_kern()
169 if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
186 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); in cmsghdr_from_user_compat_to_kern()
190 kmsg->msg_control = kcmsg_base; in cmsghdr_from_user_compat_to_kern()
191 kmsg->msg_controllen = kcmlen; in cmsghdr_from_user_compat_to_kern()
202 int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data) in put_cmsg_compat() argument
204 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control; in put_cmsg_compat()
210 if (cm == NULL || kmsg->msg_controllen < sizeof(*cm)) { in put_cmsg_compat()
211 kmsg->msg_flags |= MSG_CTRUNC; in put_cmsg_compat()
238 if (kmsg->msg_controllen < cmlen) { in put_cmsg_compat()
239 kmsg->msg_flags |= MSG_CTRUNC; in put_cmsg_compat()
240 cmlen = kmsg->msg_controllen; in put_cmsg_compat()
251 if (kmsg->msg_controllen < cmlen) in put_cmsg_compat()
252 cmlen = kmsg->msg_controllen; in put_cmsg_compat()
253 kmsg->msg_control += cmlen; in put_cmsg_compat()
254 kmsg->msg_controllen -= cmlen; in put_cmsg_compat()
258 void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm) in scm_detach_fds_compat() argument
260 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control; in scm_detach_fds_compat()
261 int fdmax = (kmsg->msg_controllen - sizeof(struct compat_cmsghdr)) / sizeof(int); in scm_detach_fds_compat()
275 err = get_unused_fd_flags(MSG_CMSG_CLOEXEC & kmsg->msg_flags in scm_detach_fds_compat()
298 kmsg->msg_control += cmlen; in scm_detach_fds_compat()
299 kmsg->msg_controllen -= cmlen; in scm_detach_fds_compat()
303 kmsg->msg_flags |= MSG_CTRUNC; in scm_detach_fds_compat()