Subject: Re: signal trampoline implementation choices
To: Emmanuel Dreyfus <email@example.com>
From: Ignatios Souvatzis <firstname.lastname@example.org>
Date: 04/20/2002 21:16:38
On Tue, Apr 16, 2002 at 09:45:41PM +0200, Emmanuel Dreyfus wrote:
> On NetBSD, the signal trampoline is copied by the kernel on the stack. I
> recently discovered that IRIX uses a signal trampoline that is provided
> by libc. The sigaction libc stub gives the signal trampoline address to
> the sigaction system call, through a fourth argument.
> Which are the motivation toward thoses different implementations? I
> found this
> for trampoline in libc:
> - the stack does not need to be executable
> for trampoline in the kernel, copied on the stack:
> - the kernel hands the signal trampoline, hence if the signal ABI
> changed, the kernel contains the new version and libc does not have to
> check kernel version for signal handling
> - hacks in libc stubs looks bad
> Anyone see another reason?
A reason NOT to do it in libc: you want to be able to signal a very
misbehaving program. E.g., one not correctly linked.