Date: Wed, 28 Jun 2006 18:08:41 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 100220 for review Message-ID: <200606281808.k5SI8fWk037659@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=100220 Change 100220 by jhb@jhb_mutex on 2006/06/28 18:07:51 Make kern_recvit() accept a separate uio_seg to specify where msg_name points to so ABIs can make that a kmem pointer rather than userland. Affected files ... .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#37 edit .. //depot/projects/smpng/sys/kern/uipc_syscalls.c#79 edit .. //depot/projects/smpng/sys/sys/syscallsubr.h#34 edit Differences ... ==== //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#37 (text+ko) ==== @@ -1009,7 +1009,8 @@ msg.msg_iov = iov; controlp = (msg.msg_control != NULL) ? &control : NULL; - error = kern_recvit(td, uap->s, &msg, NULL, UIO_USERSPACE, controlp); + error = kern_recvit(td, uap->s, &msg, NULL, UIO_USERSPACE, + UIO_USERSPACE, controlp); if (error == 0) { msg.msg_iov = uiov; @@ -1150,7 +1151,8 @@ msg.msg_control = 0; msg.msg_flags = uap->flags; error = kern_recvit(td, uap->s, &msg, - (void *)(uintptr_t)uap->fromlenaddr, UIO_USERSPACE, NULL); + (void *)(uintptr_t)uap->fromlenaddr, UIO_USERSPACE, UIO_USERSPACE, + NULL); return (error); } ==== //depot/projects/smpng/sys/kern/uipc_syscalls.c#79 (text+ko) ==== @@ -926,12 +926,12 @@ } int -kern_recvit(td, s, mp, namelenp, segflg, controlp) +kern_recvit(td, s, mp, namelenp, uioseg, fromseg, controlp) struct thread *td; int s; struct msghdr *mp; void *namelenp; - enum uio_seg segflg; + enum uio_seg uioseg, fromseg; struct mbuf **controlp; { struct uio auio; @@ -972,7 +972,7 @@ auio.uio_iov = mp->msg_iov; auio.uio_iovcnt = mp->msg_iovlen; - auio.uio_segflg = segflg; + auio.uio_segflg = uioseg; auio.uio_rw = UIO_READ; auio.uio_td = td; auio.uio_offset = 0; /* XXX */ @@ -1020,9 +1020,13 @@ ((struct osockaddr *)fromsa)->sa_family = fromsa->sa_family; #endif - error = copyout(fromsa, mp->msg_name, (unsigned)len); - if (error) - goto out; + if (fromseg == UIO_USERSPACE) { + error = copyout(fromsa, mp->msg_name, + (unsigned)len); + if (error) + goto out; + } else + bcopy(fromsa, mp->msg_name, len); } mp->msg_namelen = len; if (namelenp && @@ -1103,7 +1107,8 @@ void *namelenp; { - return (kern_recvit(td, s, mp, namelenp, UIO_USERSPACE, NULL)); + return (kern_recvit(td, s, mp, namelenp, UIO_USERSPACE, UIO_USERSPACE, + NULL)); } /* ==== //depot/projects/smpng/sys/sys/syscallsubr.h#34 (text+ko) ==== @@ -121,8 +121,9 @@ int kern_readlink(struct thread *td, char *path, enum uio_seg pathseg, char *buf, enum uio_seg bufseg, int count); int kern_readv(struct thread *td, int fd, struct uio *auio); -int kern_recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp, - enum uio_seg segflg, struct mbuf **controlp); +int kern_recvit(struct thread *td, int s, struct msghdr *mp, + void *namelenp, enum uio_seg uioseg, enum uio_seg fromseg, + struct mbuf **controlp); int kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg); int kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606281808.k5SI8fWk037659>