diff options
author | 2016-01-08 05:50:08 +0000 | |
---|---|---|
committer | 2016-01-08 05:50:08 +0000 | |
commit | 8144d7f0d076054003434030b48cf789bb07666c (patch) | |
tree | d781deac98b803efe432af39714e17f16c7bd519 | |
parent | Make sure the new rendezvous state is visible to other CPUs before (diff) | |
download | wireguard-openbsd-8144d7f0d076054003434030b48cf789bb07666c.tar.xz wireguard-openbsd-8144d7f0d076054003434030b48cf789bb07666c.zip |
On the recvmsg() side, cmsgs are in mbuf chains, not a contiguous buffer.
ktrace each cmsg instead of reading beyond the end of the first cmsg.
problem report and testing by abieber@
ok millert@ deraadt@
-rw-r--r-- | sys/kern/uipc_syscalls.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 24e7829aaa1..cce2d219db0 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.130 2015/12/05 10:11:53 tedu Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.131 2016/01/08 05:50:08 guenther Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -865,10 +865,6 @@ recvit(struct proc *p, int s, struct msghdr *mp, caddr_t namelenp, struct mbuf *m = control; caddr_t cp = mp->msg_control; -#ifdef KTRACE - if (KTRPOINT(p, KTR_STRUCT) && len) - ktrcmsghdr(p, mtod(control, char *), len); -#endif do { i = m->m_len; if (len < i) { @@ -882,6 +878,10 @@ recvit(struct proc *p, int s, struct msghdr *mp, caddr_t namelenp, len -= i; if (error != 0 || len <= 0) break; +#ifdef KTRACE + if (KTRPOINT(p, KTR_STRUCT) && i) + ktrcmsghdr(p, mtod(m, char *), i); +#endif } while ((m = m->m_next) != NULL); len = cp - (caddr_t)mp->msg_control; } |