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

Alan Coopersmith alan.coopersmith at oracle.com
Wed Nov 20 22:03:49 PST 2013


On 11/20/13 02:50 AM, Mark Kettenis wrote:
>> 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?

Yes, please go ahead and push.


-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list