Re: [PATCH] Set TIF_IRET in more places

Zack Weinberg (zack@codesourcery.com)
Mon, 06 Jan 2003 13:34:16 -0800


Linus Torvalds wrote:

> - note that for normal asynchronous signals, it _is_ important that
> we return with all registers saved, but right now that is handled
> by the fact that the signal trampoline we build in do_signal()
> will always use "int 0x80" for the sys_sigreturn() call, and will
> thus use "iret" when restoring the registers. The synchronous
> "[rt_]sigsuspend()" really is a special case in that respect.

Consider SA_RESTORER - there isn't a guarantee that user space will
use the same code as the kernel's trampoline. glibc happens to, but
only because GDB has a hardwired idea of what a signal trampoline
looks like. Of course, you could simply document that sigreturn() is
another of the system calls that must be made through int 0x80.

It occurs to me that the kernel-provided signal trampoline could go in
the page at 0xffff0000, instead of on the user stack, which would
eliminate the need for glibc to set SA_RESTORER (it's a pure
optimization).

Tangentially, I've seen people claim that the trampoline ought to be
able to avoid entering the kernel, although I'm not convinced (how
does the signal mask get reset, otherwise?)

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