Re: [braindump][RFC] signals and syscall restarts (Re: [PATCH v219/44] metag: Signal handling)

From: Jonas Bonn
Date: Sat Dec 15 2012 - 11:26:22 EST


On 8 December 2012 08:44, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Dec 06, 2012 at 10:09:55PM +0000, Al Viro wrote:
>> What we need to guarantee is
>> * restarts do not happen on signals caught in interrupts or exceptions
>> * restarts do not happen on signals caught in sigreturn()
>> * restart should happen only once, even if we get through do_signal() many
>> times.
>
> FWIW, here's the current situation:
>

> openrisc: broken. regs->orig_gpr11 can be easily used to fix - it fits the
> usual model, but isn't set by sigreturn/restarts. BTW, the comment around
> the call of do_notify_resume() in the asm glue is deeply confused - we *do*
> want the userspace pt_regs; fortunately, there can't be any on top of those
> at that point.
>

Right, I've known about this for a while and have even had a patch for
this lying about in a side-branch. I got side-tracked while fixing
this into trying to make the restart logic more generic, and the
openrisc fix never got merged upstream. I'll need to revisit this.

That said, let me point again to the series I posted for review a year
ago that attempts to make the restart logic more generic:

https://lkml.org/lkml/2011/10/23/80

The entires patch series, which doesn't necessarily even apply to
Linux master anymore due to other changes along the way, can be found
at:

git://openrisc.net/~jonas/linux ('signal-arch' branch)

Commit 4aa1797d978fe2d45ececceee535257e19374df8 is the interesting one there.

Al, what do you think?

/Jonas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/