[patch] signalfd fix for incorrect SI_QUEUE user data reporting

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, Michael Kerrisk <mtk.manpages@...>
Date: Thursday, April 10, 2008 - 2:57 pm

Michael Kerrisk found out that signalfd was not reporting back user data 
pushed using sigqueue:

http://groups.google.com/group/linux.kernel/msg/9397cab8551e3123

The following patch makes signalfd to report back the ssi_ptr and ssi_int 
members of the signalfd_siginfo structure.



Signed-off-by: Davide Libenzi <davidel@xmailserver.org>


- Davide


---
 fs/signalfd.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6.mod/fs/signalfd.c
===================================================================
--- linux-2.6.mod.orig/fs/signalfd.c	2008-04-09 11:53:37.000000000 -0700
+++ linux-2.6.mod/fs/signalfd.c	2008-04-09 12:05:46.000000000 -0700
@@ -111,9 +111,14 @@
 		err |= __put_user(kinfo->si_uid, &uinfo->ssi_uid);
 		err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
 		break;
-	default: /* this is just in case for now ... */
+	default:
+		/*
+		 * This case catches also the signals queued by sigqueue().
+		 */
 		err |= __put_user(kinfo->si_pid, &uinfo->ssi_pid);
 		err |= __put_user(kinfo->si_uid, &uinfo->ssi_uid);
+		err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
+		err |= __put_user(kinfo->si_int, &uinfo->ssi_int);
 		break;
 	}
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] signalfd fix for incorrect SI_QUEUE user data report..., Davide Libenzi, (Thu Apr 10, 2:57 pm)