Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f8738c5c5298d55ccfc26383f9f45af082a9be57
Commit:     f8738c5c5298d55ccfc26383f9f45af082a9be57
Parent:     58e78475ec706f93e0cc049449ffd11fbfdadb3e
Author:     Davide Libenzi <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 27 14:09:59 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jun 28 11:34:54 2007 -0700

    avoid spurious POLLIN returns in signalfd
    
    The new code in kernel/signal.c does not allow fetching private signals
    from another task.  This patch avoid spurious POLLIN returns from a
    signalfd poll(2) operation.
    
    Signed-off-by: Davide Libenzi <[EMAIL PROTECTED]>
    Cc: Oleg Nesterov <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/signalfd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/signalfd.c b/fs/signalfd.c
index f1da892..3b07f26 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -133,7 +133,8 @@ static unsigned int signalfd_poll(struct file *file, 
poll_table *wait)
         * the peer disconnects.
         */
        if (signalfd_lock(ctx, &lk)) {
-               if (next_signal(&lk.tsk->pending, &ctx->sigmask) > 0 ||
+               if ((lk.tsk == current &&
+                    next_signal(&lk.tsk->pending, &ctx->sigmask) > 0) ||
                    next_signal(&lk.tsk->signal->shared_pending,
                                &ctx->sigmask) > 0)
                        events |= POLLIN;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to