[PATCH libxxtrans 2/2] Fix alignment issues in FD passing code

Mark Kettenis mark.kettenis at xs4all.nl
Wed Nov 20 02:50:26 PST 2013


> Date: Tue, 12 Nov 2013 07:21:19 +0100
> From: Matthieu Herrb <matthiey at herrb.eu>
> 
> On Mon, Nov 11, 2013 at 11:22:56PM +0100, Mark Kettenis wrote:
> > From: Mark Kettenis <kettenis at openbsd.org>
> > 
> > A char array on the stack is not guaranteed to have more than byte
> > alignment.  This means that casting it to a 'struct cmsghdr' and
> > accessing its members may result in unaligned access.  This will
> > generate SIGBUS on strict alignment architectures like OpenBSD/sparc64.
> > The solution is to use a union to force proper alignment.
> > 
> > Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> 
> Reviewed-by: Matthieu Herrb <matthieu at herrb.eu>

Given that the equivalent diff for xcb has been merged, iss Matthieu's
approval enough for me to push this?


More information about the xorg-devel mailing list