about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-07-20 07:29:15 -0400
committerMike Frysinger <vapier@gentoo.org>2015-07-20 21:59:58 -0400
commitd679497db20c23e3aaaa150821ce9134cc666a18 (patch)
treecb419a38bfacfc6a3efa1b809b12b1f36d68efa6
parent01b07c70ad77ef28b6a3661ed3142ebff35b6e69 (diff)
downloadglibc-d679497db20c23e3aaaa150821ce9134cc666a18.tar.gz
glibc-d679497db20c23e3aaaa150821ce9134cc666a18.tar.xz
glibc-d679497db20c23e3aaaa150821ce9134cc666a18.zip
sparc: fix sigaction for 32bit builds [BZ #18694]
Commit a059d359d86130b5fa74e04a978c8523a0293f77 changed the sigaction
struct to pass conform tests, but it ended up also changing the ABI for
32 bit builds.  For 64 bit builds, changing the long to two ints works,
but for 32 bit builds, it inserts 4 extra bytes.  This leads to many
packages randomly failing like bash that spews things like:
	configure: line 471: wait_for: No record of process 0

Bracket the new member by a wordsize check to fix the ABI for 32bit.

(cherry picked from commit 7fde904c73c57faea48c9679bbdc0932d81b3a2f)
-rw-r--r--ChangeLog7
-rw-r--r--NEWS6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/sigaction.h4
3 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 26feb0734e..76d3e96844 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-07-21  Mike Frysinger  <vapier@gentoo.org>
+
+	[BZ #18694]
+	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: Include
+	bits/wordsize.h.
+	(sigaction): Declare __glibc_reserved0 only when __WORDSIZE is 64.
+
 2015-04-21  Arjun Shankar  <arjun.is@lostca.se>
 
 	[BZ #18287]
diff --git a/NEWS b/NEWS
index c9f6b58486..f9b359a5b7 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.21.1
 
 * The following bugs are resolved with this release:
 
-  17949, 18287.
+  17949, 18287, 18694.
 
 * A buffer overflow in gethostbyname_r and related functions performing DNS
   requests has been fixed.  If the NSS functions were called with a
@@ -17,6 +17,10 @@ Version 2.21.1
   not taken into account.  This could result in application crashes or,
   potentially arbitrary code execution, using crafted, but syntactically
   valid DNS responses.  (CVE-2015-1781)
+
+* The 32-bit sparc sigaction ABI was inadvertently broken in the 2.20 and 2.21
+  releases.  It has been fixed to match 2.19 and older, but binaries built
+  against 2.20 and 2.21 might need to be recompiled.  See BZ#18694.
 
 Version 2.21
 
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
index 0750b52038..3af5541024 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
@@ -20,6 +20,8 @@
 # error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
 #endif
 
+#include <bits/wordsize.h>
+
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
@@ -43,7 +45,9 @@ struct sigaction
     __sigset_t sa_mask;
 
     /* Special flags.  */
+#if __WORDSIZE == 64
     int __glibc_reserved0;
+#endif
     int sa_flags;
 
     /* Not used by Linux/Sparc yet.  */