Commit 31796ac4 authored by H. Peter Anvin's avatar H. Peter Anvin

x32: Fix alignment fail in struct compat_siginfo

Adding struct _sigchld_x32 caused a misalignment cascade in struct
siginfo, because union _sifields is located on an 4-byte boundary
(8-byte misaligned.)

Adding new fields that are 8-byte aligned caused the intermediate
structures to also be aligned to 8 bytes, thereby adding padding in
unexpected places.

Thus, change s64 to compat_s64 here, which makes it "misaligned on
paper".  In reality these fields *are* actually aligned (there are 3
preceeding ints outside the union and 3 inside struct _sigchld_x32),
but because of the intervening union and struct it is not possible for
gcc to avoid padding without breaking the ABI.
Reported-and-tested-by: default avatarH. J. Lu <hjl.tools@gmail.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/r/1329696488-16970-1-git-send-email-hpa@zytor.com
parent bb6fa8b2
...@@ -130,8 +130,8 @@ typedef struct compat_siginfo { ...@@ -130,8 +130,8 @@ typedef struct compat_siginfo {
unsigned int _pid; /* which child */ unsigned int _pid; /* which child */
unsigned int _uid; /* sender's uid */ unsigned int _uid; /* sender's uid */
int _status; /* exit code */ int _status; /* exit code */
s64 _utime; compat_s64 _utime;
s64 _stime; compat_s64 _stime;
} _sigchld_x32; } _sigchld_x32;
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment