aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-03-14 17:27:52 -0400
committerH. Peter Anvin <hpa@zytor.com>2012-03-14 17:27:52 -0400
commit31796ac4e8f0e88f5c10f1ad6dab8f19bebe44a4 (patch)
treec9ae9d50b327d9f5e56f689b8dea5fe6f9a2bfc1
parentbb6fa8b275e132b1e9319dbab94211543a0b7bd3 (diff)
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: H. J. Lu <hjl.tools@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1329696488-16970-1-git-send-email-hpa@zytor.com
-rw-r--r--arch/x86/include/asm/ia32.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h
index 7d0c18587709..ee52760549f0 100644
--- a/arch/x86/include/asm/ia32.h
+++ b/arch/x86/include/asm/ia32.h
@@ -130,8 +130,8 @@ typedef struct compat_siginfo {
130 unsigned int _pid; /* which child */ 130 unsigned int _pid; /* which child */
131 unsigned int _uid; /* sender's uid */ 131 unsigned int _uid; /* sender's uid */
132 int _status; /* exit code */ 132 int _status; /* exit code */
133 s64 _utime; 133 compat_s64 _utime;
134 s64 _stime; 134 compat_s64 _stime;
135 } _sigchld_x32; 135 } _sigchld_x32;
136 136
137 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 137 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */