mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] signalfd fix for incorrect SI_QUEUE user data reporting
@ 2008-04-10 18:57 Davide Libenzi
  2008-04-10 19:08 ` Andrew Morton
  2008-04-10 19:17 ` Michael Kerrisk
  0 siblings, 2 replies; 4+ messages in thread
From: Davide Libenzi @ 2008-04-10 18:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List, Michael Kerrisk

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;
 	}
 

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

* Re: [patch] signalfd fix for incorrect SI_QUEUE user data reporting
  2008-04-10 18:57 [patch] signalfd fix for incorrect SI_QUEUE user data reporting Davide Libenzi
@ 2008-04-10 19:08 ` Andrew Morton
  2008-04-10 19:13   ` Davide Libenzi
  2008-04-10 19:17 ` Michael Kerrisk
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2008-04-10 19:08 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: linux-kernel, mtk.manpages, stable

On Thu, 10 Apr 2008 11:57:44 -0700 (PDT)
Davide Libenzi <davidel@xmailserver.org> wrote:

> 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;
>  	}
>  

I queued this for both 2.6.25 and 2.6.24.x.  Agree?

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

* Re: [patch] signalfd fix for incorrect SI_QUEUE user data reporting
  2008-04-10 19:08 ` Andrew Morton
@ 2008-04-10 19:13   ` Davide Libenzi
  0 siblings, 0 replies; 4+ messages in thread
From: Davide Libenzi @ 2008-04-10 19:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List, mtk.manpages, stable

On Thu, 10 Apr 2008, Andrew Morton wrote:

> On Thu, 10 Apr 2008 11:57:44 -0700 (PDT)
> Davide Libenzi <davidel@xmailserver.org> wrote:
> 
> > 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;
> >  	}
> >  
> 
> I queued this for both 2.6.25 and 2.6.24.x.  Agree?

Looks safe for me.



- Davide



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

* Re: [patch] signalfd fix for incorrect SI_QUEUE user data reporting
  2008-04-10 18:57 [patch] signalfd fix for incorrect SI_QUEUE user data reporting Davide Libenzi
  2008-04-10 19:08 ` Andrew Morton
@ 2008-04-10 19:17 ` Michael Kerrisk
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Kerrisk @ 2008-04-10 19:17 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: Andrew Morton, Linux Kernel Mailing List

On Thu, Apr 10, 2008 at 8:57 PM, Davide Libenzi <davidel@xmailserver.org> wrote:
> 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>

Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>

>
> ---
>  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;
>        }
>
>



-- 
Michael Kerrisk
Maintainer of the Linux man-pages project
http://www.kernel.org/doc/man-pages/
Want to report a man-pages bug? Look here:
http://www.kernel.org/doc/man-pages/reporting_bugs.html

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

end of thread, other threads:[~2008-04-10 19:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-10 18:57 [patch] signalfd fix for incorrect SI_QUEUE user data reporting Davide Libenzi
2008-04-10 19:08 ` Andrew Morton
2008-04-10 19:13   ` Davide Libenzi
2008-04-10 19:17 ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®