diff options
author | Davide Libenzi <davidel@xmailserver.org> | 2007-06-27 17:09:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-28 14:34:54 -0400 |
commit | f8738c5c5298d55ccfc26383f9f45af082a9be57 (patch) | |
tree | baa7c6f2a31dcc4c4d2875f73b1462be5fbb388d /fs | |
parent | 58e78475ec706f93e0cc049449ffd11fbfdadb3e (diff) |
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 <davidel@xmailserver.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/signalfd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/signalfd.c b/fs/signalfd.c index f1da89203a9a..3b07f26d984d 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c | |||
@@ -133,7 +133,8 @@ static unsigned int signalfd_poll(struct file *file, poll_table *wait) | |||
133 | * the peer disconnects. | 133 | * the peer disconnects. |
134 | */ | 134 | */ |
135 | if (signalfd_lock(ctx, &lk)) { | 135 | if (signalfd_lock(ctx, &lk)) { |
136 | if (next_signal(&lk.tsk->pending, &ctx->sigmask) > 0 || | 136 | if ((lk.tsk == current && |
137 | next_signal(&lk.tsk->pending, &ctx->sigmask) > 0) || | ||
137 | next_signal(&lk.tsk->signal->shared_pending, | 138 | next_signal(&lk.tsk->signal->shared_pending, |
138 | &ctx->sigmask) > 0) | 139 | &ctx->sigmask) > 0) |
139 | events |= POLLIN; | 140 | events |= POLLIN; |