Lines Matching full:kmsg

36 int __get_compat_msghdr(struct msghdr *kmsg,  in __get_compat_msghdr()  argument
42 kmsg->msg_flags = msg->msg_flags; in __get_compat_msghdr()
43 kmsg->msg_namelen = msg->msg_namelen; in __get_compat_msghdr()
46 kmsg->msg_namelen = 0; in __get_compat_msghdr()
48 if (kmsg->msg_namelen < 0) in __get_compat_msghdr()
51 if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) in __get_compat_msghdr()
52 kmsg->msg_namelen = sizeof(struct sockaddr_storage); in __get_compat_msghdr()
54 kmsg->msg_control_is_user = true; in __get_compat_msghdr()
55 kmsg->msg_get_inq = 0; in __get_compat_msghdr()
56 kmsg->msg_control_user = compat_ptr(msg->msg_control); in __get_compat_msghdr()
57 kmsg->msg_controllen = msg->msg_controllen; in __get_compat_msghdr()
62 if (msg->msg_name && kmsg->msg_namelen) { in __get_compat_msghdr()
65 kmsg->msg_namelen, in __get_compat_msghdr()
66 kmsg->msg_name); in __get_compat_msghdr()
71 kmsg->msg_name = NULL; in __get_compat_msghdr()
72 kmsg->msg_namelen = 0; in __get_compat_msghdr()
78 kmsg->msg_iocb = NULL; in __get_compat_msghdr()
79 kmsg->msg_ubuf = NULL; in __get_compat_msghdr()
83 int get_compat_msghdr(struct msghdr *kmsg, in get_compat_msghdr() argument
94 err = __get_compat_msghdr(kmsg, &msg, save_addr); in get_compat_msghdr()
100 UIO_FASTIOV, iov, &kmsg->msg_iter); in get_compat_msghdr()
139 int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, in cmsghdr_from_user_compat_to_kern() argument
153 ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); in cmsghdr_from_user_compat_to_kern()
159 if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
165 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); in cmsghdr_from_user_compat_to_kern()
171 * It may not be modified as we do not stick it into the kmsg in cmsghdr_from_user_compat_to_kern()
182 ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg); in cmsghdr_from_user_compat_to_kern()
187 if (!CMSG_COMPAT_OK(cmsg.cmsg_len, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
203 ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, cmsg.cmsg_len); in cmsghdr_from_user_compat_to_kern()
214 kmsg->msg_control_is_user = false; in cmsghdr_from_user_compat_to_kern()
215 kmsg->msg_control = kcmsg_base; in cmsghdr_from_user_compat_to_kern()
216 kmsg->msg_controllen = kcmlen; in cmsghdr_from_user_compat_to_kern()
227 int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data) in put_cmsg_compat() argument
229 struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control_user; in put_cmsg_compat()
235 if (cm == NULL || kmsg->msg_controllen < sizeof(*cm)) { in put_cmsg_compat()
236 kmsg->msg_flags |= MSG_CTRUNC; in put_cmsg_compat()
263 if (kmsg->msg_controllen < cmlen) { in put_cmsg_compat()
264 kmsg->msg_flags |= MSG_CTRUNC; in put_cmsg_compat()
265 cmlen = kmsg->msg_controllen; in put_cmsg_compat()
276 if (kmsg->msg_controllen < cmlen) in put_cmsg_compat()
277 cmlen = kmsg->msg_controllen; in put_cmsg_compat()
278 kmsg->msg_control_user += cmlen; in put_cmsg_compat()
279 kmsg->msg_controllen -= cmlen; in put_cmsg_compat()