Commit 2a1486981c1317dc4f4aad568f2cc6e49dfb8c82

Authored by David Howells
Committed by Ralf Baechle
1 parent 1762c5ab7c

Fix breakage in MIPS siginfo handling

MIPS's siginfo handling has been broken since this commit:

	commit 574c4866e33d648520a8bd5bf6f573ea6e554e88
	Author: Al Viro <viro@zeniv.linux.org.uk>
	Date:   Sun Nov 25 22:24:19 2012 -0500
	consolidate kernel-side struct sigaction declarations

for 64-bit BE MIPS CPUs.

The UAPI variant looks like this:

	struct sigaction {
		unsigned int	sa_flags;
		__sighandler_t	sa_handler;
		sigset_t	sa_mask;
	};

but the core kernel's variant looks like this:

	struct sigaction {
	#ifndef __ARCH_HAS_ODD_SIGACTION
		__sighandler_t	sa_handler;
		unsigned long	sa_flags;
	#else
		unsigned long	sa_flags;
		__sighandler_t	sa_handler;
	#endif
	#ifdef __ARCH_HAS_SA_RESTORER
		__sigrestore_t sa_restorer;
	#endif
		sigset_t	sa_mask;
	};

The problem is that sa_flags has been changed from an unsigned int to an
unsigned long.

Fix this by making sa_flags unsigned int if __ARCH_HAS_ODD_SIGACTION is
defined.

Whilst we're at it, rename __ARCH_HAS_ODD_SIGACTION to
__ARCH_HAS_IRIX_SIGACTION.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Showing 3 changed files with 5 additions and 5 deletions Side-by-side Diff

arch/mips/include/asm/signal.h
... ... @@ -21,7 +21,7 @@
21 21 #include <asm/sigcontext.h>
22 22 #include <asm/siginfo.h>
23 23  
24   -#define __ARCH_HAS_ODD_SIGACTION
  24 +#define __ARCH_HAS_IRIX_SIGACTION
25 25  
26 26 #endif /* _ASM_SIGNAL_H */
include/linux/compat.h
... ... @@ -141,11 +141,11 @@
141 141 } compat_sigset_t;
142 142  
143 143 struct compat_sigaction {
144   -#ifndef __ARCH_HAS_ODD_SIGACTION
  144 +#ifndef __ARCH_HAS_IRIX_SIGACTION
145 145 compat_uptr_t sa_handler;
146 146 compat_ulong_t sa_flags;
147 147 #else
148   - compat_ulong_t sa_flags;
  148 + compat_uint_t sa_flags;
149 149 compat_uptr_t sa_handler;
150 150 #endif
151 151 #ifdef __ARCH_HAS_SA_RESTORER
include/linux/signal.h
... ... @@ -250,11 +250,11 @@
250 250 extern int sigsuspend(sigset_t *);
251 251  
252 252 struct sigaction {
253   -#ifndef __ARCH_HAS_ODD_SIGACTION
  253 +#ifndef __ARCH_HAS_IRIX_SIGACTION
254 254 __sighandler_t sa_handler;
255 255 unsigned long sa_flags;
256 256 #else
257   - unsigned long sa_flags;
  257 + unsigned int sa_flags;
258 258 __sighandler_t sa_handler;
259 259 #endif
260 260 #ifdef __ARCH_HAS_SA_RESTORER