lkml.org 
[lkml]   [2016]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] signals: work around random wakeups in sigsuspend()
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);



\
 
 \ /
  Last update: 2016-01-27 10:01    [W:0.461 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site