<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Jakub Jelinek &lt;jakub@redhat.com&gt;

The first change removes just a useless put_user (si_int and si_ptr are
part of the same union, si_ptr is on all arches covering whole union), the
rest is fixes for signal handling of SI_MESGQ.


---

 25-akpm/arch/ia64/ia32/ia32_signal.c     |    4 ++--
 25-akpm/arch/mips/kernel/signal32.c      |    4 ++--
 25-akpm/arch/s390/kernel/compat_signal.c |    4 ++--
 25-akpm/arch/sparc64/kernel/signal32.c   |    4 ++--
 25-akpm/arch/x86_64/ia32/ia32_signal.c   |    4 ++--
 25-akpm/include/asm-mips/siginfo.h       |    2 +-
 25-akpm/kernel/signal.c                  |    1 -
 7 files changed, 11 insertions(+), 12 deletions(-)

diff -puN arch/ia64/ia32/ia32_signal.c~fix-mq-32-bit-compatibility arch/ia64/ia32/ia32_signal.c
--- 25/arch/ia64/ia32/ia32_signal.c~fix-mq-32-bit-compatibility	2004-04-14 21:04:46.805055000 -0700
+++ 25-akpm/arch/ia64/ia32/ia32_signal.c	2004-04-14 21:04:46.841049528 -0700
@@ -114,8 +114,8 @@ copy_siginfo_from_user32 (siginfo_t *to,
 			err |= __get_user(to-&gt;si_band, &amp;from-&gt;si_band);
 			err |= __get_user(to-&gt;si_fd, &amp;from-&gt;si_fd);
 			break;
-		      case __SI_RT: /* This is not generated by the kernel as of now.  */
-		      case __SI_MESGQ:
+		      case __SI_RT &gt;&gt; 16: /* This is not generated by the kernel as of now.  */
+		      case __SI_MESGQ &gt;&gt; 16:
 			err |= __get_user(to-&gt;si_pid, &amp;from-&gt;si_pid);
 			err |= __get_user(to-&gt;si_uid, &amp;from-&gt;si_uid);
 			err |= __get_user(to-&gt;si_int, &amp;from-&gt;si_int);
diff -puN arch/mips/kernel/signal32.c~fix-mq-32-bit-compatibility arch/mips/kernel/signal32.c
--- 25/arch/mips/kernel/signal32.c~fix-mq-32-bit-compatibility	2004-04-14 21:04:46.807054696 -0700
+++ 25-akpm/arch/mips/kernel/signal32.c	2004-04-14 21:04:46.840049680 -0700
@@ -358,8 +358,8 @@ static int copy_siginfo_to_user32(siginf
 			err |= __put_user(from-&gt;si_band, &amp;to-&gt;si_band);
 			err |= __put_user(from-&gt;si_fd, &amp;to-&gt;si_fd);
 			break;
-		case __SI_RT: /* This is not generated by the kernel as of now.  */
-		case __SI_MESGQ:
+		case __SI_RT &gt;&gt; 16: /* This is not generated by the kernel as of now.  */
+		case __SI_MESGQ &gt;&gt; 16:
 			err |= __put_user(from-&gt;si_pid, &amp;to-&gt;si_pid);
 			err |= __put_user(from-&gt;si_uid, &amp;to-&gt;si_uid);
 			err |= __put_user(from-&gt;si_int, &amp;to-&gt;si_int);
diff -puN arch/s390/kernel/compat_signal.c~fix-mq-32-bit-compatibility arch/s390/kernel/compat_signal.c
--- 25/arch/s390/kernel/compat_signal.c~fix-mq-32-bit-compatibility	2004-04-14 21:04:46.817053176 -0700
+++ 25-akpm/arch/s390/kernel/compat_signal.c	2004-04-14 21:04:46.840049680 -0700
@@ -74,8 +74,8 @@ int copy_siginfo_to_user32(siginfo_t32 *
 		err |= __copy_to_user(&amp;to-&gt;_sifields._pad, &amp;from-&gt;_sifields._pad, SI_PAD_SIZE);
 	else {
 		switch (from-&gt;si_code &gt;&gt; 16) {
-		case __SI_RT: /* This is not generated by the kernel as of now.  */
-		case __SI_MESGQ:
+		case __SI_RT &gt;&gt; 16: /* This is not generated by the kernel as of now.  */
+		case __SI_MESGQ &gt;&gt; 16:
 			err |= __put_user(from-&gt;si_int, &amp;to-&gt;si_int);
 			/* fallthrough */
 		case __SI_KILL &gt;&gt; 16:
diff -puN arch/sparc64/kernel/signal32.c~fix-mq-32-bit-compatibility arch/sparc64/kernel/signal32.c
--- 25/arch/sparc64/kernel/signal32.c~fix-mq-32-bit-compatibility	2004-04-14 21:04:46.818053024 -0700
+++ 25-akpm/arch/sparc64/kernel/signal32.c	2004-04-14 21:04:46.839049832 -0700
@@ -129,8 +129,8 @@ int copy_siginfo_to_user32(siginfo_t32 _
 			err |= __put_user(from-&gt;si_trapno, &amp;to-&gt;si_trapno);
 			err |= __put_user((long)from-&gt;si_addr, &amp;to-&gt;si_addr);
 			break;
-		case __SI_RT: /* This is not generated by the kernel as of now.  */
-		case __SI_MESGQ:
+		case __SI_RT &gt;&gt; 16: /* This is not generated by the kernel as of now.  */
+		case __SI_MESGQ &gt;&gt; 16:
 			err |= __put_user(from-&gt;si_pid, &amp;to-&gt;si_pid);
 			err |= __put_user(from-&gt;si_uid, &amp;to-&gt;si_uid);
 			err |= __put_user(from-&gt;si_int, &amp;to-&gt;si_int);
diff -puN arch/x86_64/ia32/ia32_signal.c~fix-mq-32-bit-compatibility arch/x86_64/ia32/ia32_signal.c
--- 25/arch/x86_64/ia32/ia32_signal.c~fix-mq-32-bit-compatibility	2004-04-14 21:04:46.819052872 -0700
+++ 25-akpm/arch/x86_64/ia32/ia32_signal.c	2004-04-14 21:04:46.842049376 -0700
@@ -85,8 +85,8 @@ int ia32_copy_siginfo_to_user(siginfo_t3
 			err |= __put_user(from-&gt;si_overrun, &amp;to-&gt;si_overrun); 
 			err |= __put_user((u32)(u64)from-&gt;si_ptr, &amp;to-&gt;si_ptr);
 			break;
-		case __SI_RT: /* This is not generated by the kernel as of now.  */
-		case __SI_MESGQ:
+		case __SI_RT &gt;&gt; 16: /* This is not generated by the kernel as of now.  */
+		case __SI_MESGQ &gt;&gt; 16:
 			err |= __put_user(from-&gt;si_uid, &amp;to-&gt;si_uid);
 			err |= __put_user(from-&gt;si_int, &amp;to-&gt;si_int);
 			break;
diff -puN include/asm-mips/siginfo.h~fix-mq-32-bit-compatibility include/asm-mips/siginfo.h
--- 25/include/asm-mips/siginfo.h~fix-mq-32-bit-compatibility	2004-04-14 21:04:46.827051656 -0700
+++ 25-akpm/include/asm-mips/siginfo.h	2004-04-14 21:04:46.836050288 -0700
@@ -175,7 +175,7 @@ typedef struct siginfo32 {
 #undef SI_MESGQ
 #define SI_ASYNCIO	-2	/* sent by AIO completion */
 #define SI_TIMER __SI_CODE(__SI_TIMER,-3) /* sent by timer expiration */
-#define SI_MESGQ	-4	/* sent by real time mesq state change */
+#define SI_MESGQ __SI_CODE(__SI_MESGQ,-4) /* sent by real time mesq state change */
 
 #ifdef __KERNEL__
 
diff -puN kernel/signal.c~fix-mq-32-bit-compatibility kernel/signal.c
--- 25/kernel/signal.c~fix-mq-32-bit-compatibility	2004-04-14 21:04:46.829051352 -0700
+++ 25-akpm/kernel/signal.c	2004-04-14 21:04:46.835050440 -0700
@@ -2060,7 +2060,6 @@ int copy_siginfo_to_user(siginfo_t __use
 	case __SI_MESGQ: /* But this is */
 		err |= __put_user(from-&gt;si_pid, &amp;to-&gt;si_pid);
 		err |= __put_user(from-&gt;si_uid, &amp;to-&gt;si_uid);
-		err |= __put_user(from-&gt;si_int, &amp;to-&gt;si_int);
 		err |= __put_user(from-&gt;si_ptr, &amp;to-&gt;si_ptr);
 		break;
 	default: /* this is just in case for now ... */

_
</pre></body></html>