• Home
  • Raw
  • Download

Lines Matching refs:kmsg

36 int get_compat_msghdr(struct msghdr *kmsg,  in get_compat_msghdr()  argument
47 kmsg->msg_flags = msg.msg_flags; in get_compat_msghdr()
48 kmsg->msg_namelen = msg.msg_namelen; in get_compat_msghdr()
51 kmsg->msg_namelen = 0; in get_compat_msghdr()
53 if (kmsg->msg_namelen < 0) in get_compat_msghdr()
56 if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) in get_compat_msghdr()
57 kmsg->msg_namelen = sizeof(struct sockaddr_storage); in get_compat_msghdr()
59 kmsg->msg_control = compat_ptr(msg.msg_control); in get_compat_msghdr()
60 kmsg->msg_controllen = msg.msg_controllen; in get_compat_msghdr()
65 if (msg.msg_name && kmsg->msg_namelen) { in get_compat_msghdr()
68 kmsg->msg_namelen, in get_compat_msghdr()
69 kmsg->msg_name); in get_compat_msghdr()
74 kmsg->msg_name = NULL; in get_compat_msghdr()
75 kmsg->msg_namelen = 0; in get_compat_msghdr()
81 kmsg->msg_iocb = NULL; in get_compat_msghdr()
85 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
138 ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); in cmsghdr_from_user_compat_to_kern()
144 if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
150 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); in cmsghdr_from_user_compat_to_kern()
167 ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); in cmsghdr_from_user_compat_to_kern()
171 if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
187 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); in cmsghdr_from_user_compat_to_kern()
198 kmsg->msg_control = kcmsg_base; in cmsghdr_from_user_compat_to_kern()
199 kmsg->msg_controllen = kcmlen; in cmsghdr_from_user_compat_to_kern()
210 int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data) in put_cmsg_compat() argument
212 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control; in put_cmsg_compat()
218 if (cm == NULL || kmsg->msg_controllen < sizeof(*cm)) { in put_cmsg_compat()
219 kmsg->msg_flags |= MSG_CTRUNC; in put_cmsg_compat()
246 if (kmsg->msg_controllen < cmlen) { in put_cmsg_compat()
247 kmsg->msg_flags |= MSG_CTRUNC; in put_cmsg_compat()
248 cmlen = kmsg->msg_controllen; in put_cmsg_compat()
259 if (kmsg->msg_controllen < cmlen) in put_cmsg_compat()
260 cmlen = kmsg->msg_controllen; in put_cmsg_compat()
261 kmsg->msg_control += cmlen; in put_cmsg_compat()
262 kmsg->msg_controllen -= cmlen; in put_cmsg_compat()
266 void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm) in scm_detach_fds_compat() argument
268 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control; in scm_detach_fds_compat()
269 int fdmax = (kmsg->msg_controllen - sizeof(struct compat_cmsghdr)) / sizeof(int); in scm_detach_fds_compat()
283 err = get_unused_fd_flags(MSG_CMSG_CLOEXEC & kmsg->msg_flags in scm_detach_fds_compat()
307 kmsg->msg_control += cmlen; in scm_detach_fds_compat()
308 kmsg->msg_controllen -= cmlen; in scm_detach_fds_compat()
312 kmsg->msg_flags |= MSG_CTRUNC; in scm_detach_fds_compat()