[lkml]   [2008]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86_64: fix delayed signals

On Thu, 10 Jul 2008, Roland McGrath wrote:
> There are many different scenarios that could hit this bug, most of
> them races. The simplest one to demonstrate does not require any
> race: when one signal has done handler setup at the check before
> returning from a syscall, and there is another signal pending that
> should be handled. The second signal's handler should interrupt the
> first signal handler before it actually starts (so the interrupted PC
> is still at the handler's entry point). Instead, it runs away until
> the next kernel entry (next syscall, tick, etc).

I have this dim memory of at least _some_ of this being on purpose.

If you look at old kernels (_really_ old ones - I think it's way before
even the historical git archive, but I didn't take a look), we used to set
up several stack frames at once, so that we'd nest the stack frames

In other words, the code in do_signal() used to literally be a loop,
something like

while ((signr = get_signal_to_deliver(&info, &ka, regs, NULL)) > 0) {
.. setup signal frame ..

(No, I don't think that's at all accurate of the actual code we used to
have - I just took the current do_signal() code as an example)

And that explicit loop was removed in order for us to have just a single
outstanding signal at a time. I forget the exact details why.

But if you really want that behaviour, then re-introducing the loop would
likely be the better approach (or should be combined), since I think you
effectively just re-introduced it (at a much bigger granularity).



 \ /
  Last update: 2008-07-11 00:11    [W:0.178 / U:1.780 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site