Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1319169
| From | Sasha Levin <sasha.levin@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] signals: work around random wakeups in sigsuspend() |
| Date | 2016-01-27 18:30 +0100 |
| Message-ID | <qVC4O-6X5-19@gated-at.bofh.it> (permalink) |
| References | <qURIG-68y-83@gated-at.bofh.it> <qUX1F-1E8-13@gated-at.bofh.it> <qVjbR-1GJ-29@gated-at.bofh.it> <qVtXz-Pn-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 01/27/2016 03:44 AM, Peter Zijlstra wrote:
> On Tue, Jan 26, 2016 at 10:10:09PM +0100, Oleg Nesterov wrote:
>
>> And, ironically, there is another more serious "reverse" problem ;) sigsuspend()
>> orany other user of -ERESTARTNOHAND can "miss" the signal, in a sense that the
>> kernel can wrongly restart this syscall after return from signal handler. This
>> is not trivial to fix..
>
> So I'm not entirely sure I get what you mean there. But it did get me to
> look at the patch again:
>
> + while (!signal_pending(current)) {
> + __set_current_state(TASK_INTERRUPTIBLE);
> + schedule();
> + }
>
> That should very much be:
>
> for (;;) {
> set_current_state(TASK_INTERRUPTIBLE);
> if (signal_pending(current))
> break;
> schedule();
> }
> __set_current_state(TASK_RUNNING);
Should that be the case for sys_pause() too?
Thanks,
Sasha
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] signals: work around random wakeups in sigsuspend() Sasha Levin <sasha.levin@oracle.com> - 2016-01-25 17:00 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Oleg Nesterov <oleg@redhat.com> - 2016-01-25 20:10 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Peter Zijlstra <peterz@infradead.org> - 2016-01-25 20:40 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Andrew Morton <akpm@linux-foundation.org> - 2016-01-25 22:40 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Oleg Nesterov <oleg@redhat.com> - 2016-01-26 22:20 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Peter Zijlstra <peterz@infradead.org> - 2016-01-27 09:50 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Oleg Nesterov <oleg@redhat.com> - 2016-01-27 17:50 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Peter Zijlstra <peterz@infradead.org> - 2016-01-27 19:00 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Andrew Morton <akpm@linux-foundation.org> - 2016-01-27 19:40 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Oleg Nesterov <oleg@redhat.com> - 2016-01-27 22:10 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Sasha Levin <sasha.levin@oracle.com> - 2016-01-27 18:30 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Ingo Molnar <mingo@kernel.org> - 2016-01-26 07:50 +0100
Re: [PATCH] signals: work around random wakeups in sigsuspend() Oleg Nesterov <oleg@redhat.com> - 2016-01-26 16:10 +0100
csiph-web