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_is_user = true; in __get_compat_msghdr()
60 kmsg->msg_control_user = compat_ptr(msg.msg_control); in __get_compat_msghdr()
61 kmsg->msg_controllen = msg.msg_controllen; in __get_compat_msghdr()
66 if (msg.msg_name && 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()
88 int get_compat_msghdr(struct msghdr *kmsg, in get_compat_msghdr() argument
97 err = __get_compat_msghdr(kmsg, umsg, save_addr, &ptr, &len); in get_compat_msghdr()
102 UIO_FASTIOV, iov, &kmsg->msg_iter); in get_compat_msghdr()
141 int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, in cmsghdr_from_user_compat_to_kern() argument
155 ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); in cmsghdr_from_user_compat_to_kern()
161 if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
167 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); in cmsghdr_from_user_compat_to_kern()
184 ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); in cmsghdr_from_user_compat_to_kern()
189 if (!CMSG_COMPAT_OK(cmsg.cmsg_len, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
205 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, cmsg.cmsg_len); in cmsghdr_from_user_compat_to_kern()
216 kmsg->msg_control = kcmsg_base; in cmsghdr_from_user_compat_to_kern()
217 kmsg->msg_controllen = kcmlen; in cmsghdr_from_user_compat_to_kern()
228 int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data) in put_cmsg_compat() argument
230 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control; in put_cmsg_compat()
236 if (cm == NULL || kmsg->msg_controllen < sizeof(*cm)) { in put_cmsg_compat()
237 kmsg->msg_flags |= MSG_CTRUNC; in put_cmsg_compat()
264 if (kmsg->msg_controllen < cmlen) { in put_cmsg_compat()
265 kmsg->msg_flags |= MSG_CTRUNC; in put_cmsg_compat()
266 cmlen = kmsg->msg_controllen; in put_cmsg_compat()
277 if (kmsg->msg_controllen < cmlen) in put_cmsg_compat()
278 cmlen = kmsg->msg_controllen; in put_cmsg_compat()
279 kmsg->msg_control += cmlen; in put_cmsg_compat()
280 kmsg->msg_controllen -= cmlen; in put_cmsg_compat()