[Xcb] [PATCH libxcb] Fix alignment issues in FD passing code
Uli Schlachter
psychon at znc.in
Mon Nov 18 07:56:13 PST 2013
Hi,
On 12.11.2013 07:15, Matthieu Herrb wrote:
> On Mon, Nov 11, 2013 at 11:11: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 struct
>> alignment architectures like OpenBSD/sparc64. The canonical 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>
[...]
No idea if this is "good enough" for whatever problems people can come up with
(see "that other reply" from xorg-devel). However, this patch definitely
improves the situation. Thus:
Merged, thanks!
Cheers,
Uli
--
"Every once in a while, declare peace. It confuses the hell out of your enemies"
- 79th Rule of Acquisition
More information about the Xcb
mailing list