https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236737
Bug ID: 236737 Summary: recvmsg() under COMPAT_FREEBSD32 returns the wrong msg_controllen value Product: Base System Version: 12.0-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: b...@freebsd.org Reporter: paulz...@gmail.com Created attachment 203071 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=203071&action=edit udp recvmsg with IP_RECVDSTADDR, IP_RECVTTL and IP_RECVIF setsockopts enabled The returned msg_controllen is shorter under FreeBSD AMD64 12.0-RELEASE with COMPAT_FREEBSD32 mode compared to the same value on an actual i386 system. While the returned msg_controllen is shorter, the corresponding cmsg_len values remain the same. This causes the last cmsg to exceed the msg_control[0:msg_controllen] buffer. This does not seem to be detected using the CMSG_NXTHDR/CMSG_DATA macros. This behavior triggers unit test failures in the Go golang.org/x/net package. A workaround has been applied in https://go-review.googlesource.com/c/net/+/168297 where the kernel returned msg_controllen is effectively extended to size passed by the caller. Attached is a C demonstrator based on one of the unit tests. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"