stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix breakage in MIPS siginfo handling
@ 2013-03-19 15:00 David Howells
  2013-03-19 15:05 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2013-03-19 15:00 UTC (permalink / raw)
  To: viro; +Cc: linux-mips, stable, linux-kernel, Ralf Baechle, Al Viro

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: Al Viro <viro@ZenIV.linux.org.uk>
cc: Ralf Baechle <ralf@linux-mips.org>
cc: linux-mips@linux-mips.org
cc: stable@vger.kernel.org
---

 arch/mips/include/asm/signal.h |    2 +-
 include/linux/compat.h         |    4 ++--
 include/linux/signal.h         |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/signal.h b/arch/mips/include/asm/signal.h
index 197f636..8efe5a9 100644
--- a/arch/mips/include/asm/signal.h
+++ b/arch/mips/include/asm/signal.h
@@ -21,6 +21,6 @@
 #include <asm/sigcontext.h>
 #include <asm/siginfo.h>
 
-#define __ARCH_HAS_ODD_SIGACTION
+#define __ARCH_HAS_IRIX_SIGACTION
 
 #endif /* _ASM_SIGNAL_H */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 76a87fb..377cd8c 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -141,11 +141,11 @@ typedef struct {
 } compat_sigset_t;
 
 struct compat_sigaction {
-#ifndef __ARCH_HAS_ODD_SIGACTION
+#ifndef __ARCH_HAS_IRIX_SIGACTION
 	compat_uptr_t			sa_handler;
 	compat_ulong_t			sa_flags;
 #else
-	compat_ulong_t			sa_flags;
+	compat_uint_t			sa_flags;
 	compat_uptr_t			sa_handler;
 #endif
 #ifdef __ARCH_HAS_SA_RESTORER
diff --git a/include/linux/signal.h b/include/linux/signal.h
index a2dcb94..9475c5c 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -250,11 +250,11 @@ extern int show_unhandled_signals;
 extern int sigsuspend(sigset_t *);
 
 struct sigaction {
-#ifndef __ARCH_HAS_ODD_SIGACTION
+#ifndef __ARCH_HAS_IRIX_SIGACTION
 	__sighandler_t	sa_handler;
 	unsigned long	sa_flags;
 #else
-	unsigned long	sa_flags;
+	unsigned int	sa_flags;
 	__sighandler_t	sa_handler;
 #endif
 #ifdef __ARCH_HAS_SA_RESTORER


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix breakage in MIPS siginfo handling
  2013-03-19 15:00 [PATCH] Fix breakage in MIPS siginfo handling David Howells
@ 2013-03-19 15:05 ` Al Viro
  2013-03-19 18:19   ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2013-03-19 15:05 UTC (permalink / raw)
  To: David Howells; +Cc: linux-mips, stable, linux-kernel, Ralf Baechle

On Tue, Mar 19, 2013 at 03:00:53PM +0000, David Howells wrote:
> 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: Al Viro <viro@ZenIV.linux.org.uk>
> cc: Ralf Baechle <ralf@linux-mips.org>
> cc: linux-mips@linux-mips.org
> cc: stable@vger.kernel.org

ACKed-by: Al Viro <viro@zeniv.linux.org.uk>

but I think it should go via mips tree (or straight to Linus, for that
matter).  I can apply it in signal.git and push it to Linus today, though...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix breakage in MIPS siginfo handling
  2013-03-19 15:05 ` Al Viro
@ 2013-03-19 18:19   ` Ralf Baechle
  0 siblings, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2013-03-19 18:19 UTC (permalink / raw)
  To: Al Viro; +Cc: David Howells, linux-mips, stable, linux-kernel

On Tue, Mar 19, 2013 at 03:05:30PM +0000, Al Viro wrote:

> ACKed-by: Al Viro <viro@zeniv.linux.org.uk>
> 
> but I think it should go via mips tree (or straight to Linus, for that
> matter).  I can apply it in signal.git and push it to Linus today, though...

I've applied it to my tree.  Since I applied a number of other 3.9 fixes
I'm going to wait for another day before sending out a pull request to
Linus.

Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-19 18:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-19 15:00 [PATCH] Fix breakage in MIPS siginfo handling David Howells
2013-03-19 15:05 ` Al Viro
2013-03-19 18:19   ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).