Date: Fri, 08 Sep 2017 08:56:38 -0600 From: Ian Lepore <ian@freebsd.org> To: John Baldwin <jhb@FreeBSD.org>, Maxim Sobolev <sobomax@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323254 - head/sys/compat/freebsd32 Message-ID: <1504882598.32063.3.camel@freebsd.org> In-Reply-To: <6d00a409-2be8-fc15-b68f-993d97366aab@FreeBSD.org> References: <201709070429.v874Tvom033960@repo.freebsd.org> <6d00a409-2be8-fc15-b68f-993d97366aab@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2017-09-08 at 08:14 -0400, John Baldwin wrote: > On 9/7/17 12:29 AM, Maxim Sobolev wrote: > >=20 > > Author: sobomax > > Date: Thu Sep=A0=A07 04:29:57 2017 > > New Revision: 323254 > > URL: https://svnweb.freebsd.org/changeset/base/323254 > >=20 > > Log: > > =A0 In the recvmsg32() system call iterate over returned structure(s) > > =A0 and convert any messages of types SCM_BINTIME, SCM_TIMESTAMP, > > =A0 SCM_REALTIME and SCM_MONOTONIC from 64-bit to its 32-bit > > =A0 representation. Otherwise we either run out of user-supplied > > =A0 buffer to copy those out resulting in the MSG_CTRUNC or simply > > =A0 return values that the userland 32-bit code is not going > > =A0 to parse correctly. This fixes at least two regression tests > > =A0 failing to function properly in 32-bit compat mode: > > =A0=A0 > > =A0=A0=A0=A0=A0=A0tools/regression/sockets/udp_pingpong > > =A0=A0=A0=A0=A0=A0tools/regression/sockets/unix_cmsg > > =A0=A0 > > =A0 PR:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0kern/222039 > > =A0 MFC after: 30 days > Is this correct on !amd64?=A0=A0Other 32-bit platforms use a 64-bit tim= e_t > (note the time32_t type defined earlier in freebsd32.h).=A0=A0struct bi= ntime32 > should use time32_t for the seconds field, not uint32_t.=A0=A0I think t= hat > will be sufficient to make this correct on !amd64 (it also means that > bintime32 =3D=3D bintime on !amd64 so you could perhaps use a simpler B= T_CP > for !amd64, but the existing one is probably ok). >=20 The existing one now does *(uint64_t *) on a value that's only aligned to a 32-bit boundary. =A0That will work in practice because only i386 has a 32-bit time_t that will use this code, and it's not a strict- alignment platform. =A0It may still cause compiler warnings about alignment. -- Ian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1504882598.32063.3.camel>