[patch] signalfd fix for incorrect SI_QUEUE user data reporting - Kernel

This is a discussion on [patch] signalfd fix for incorrect SI_QUEUE user data reporting - Kernel ; Michael Kerrisk found out that signalfd was not reporting back user data pushed using sigqueue: http://groups.google.com/group/linux...97cab8551e3123 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 - Davide --- fs/signalfd.c ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: [patch] signalfd fix for incorrect SI_QUEUE user data reporting

  1. [patch] signalfd fix for incorrect SI_QUEUE user data reporting

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

    http://groups.google.com/group/linux...97cab8551e3123

    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


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

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [patch] signalfd fix for incorrect SI_QUEUE user data reporting

    On Thu, 10 Apr 2008 11:57:44 -0700 (PDT)
    Davide Libenzi wrote:

    > Michael Kerrisk found out that signalfd was not reporting back user data
    > pushed using sigqueue:
    >
    > http://groups.google.com/group/linux...97cab8551e3123
    >
    > 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
    >
    >
    > - 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?
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [patch] signalfd fix for incorrect SI_QUEUE user data reporting

    On Thu, 10 Apr 2008, Andrew Morton wrote:

    > On Thu, 10 Apr 2008 11:57:44 -0700 (PDT)
    > Davide Libenzi wrote:
    >
    > > Michael Kerrisk found out that signalfd was not reporting back user data
    > > pushed using sigqueue:
    > >
    > > http://groups.google.com/group/linux...97cab8551e3123
    > >
    > > 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
    > >
    > >
    > > - 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


    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. Re: [patch] signalfd fix for incorrect SI_QUEUE user data reporting

    On Thu, Apr 10, 2008 at 8:57 PM, Davide Libenzi wrote:
    > Michael Kerrisk found out that signalfd was not reporting back user data
    > pushed using sigqueue:
    >
    > http://groups.google.com/group/linux...97cab8551e3123
    >
    > 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


    Acked-by: Michael Kerrisk

    >
    > ---
    > 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
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread