Date: Fri, 04 Nov 2005 11:38:37 +0100 From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) To: martinko <martinkov@pobox.sk> Cc: freebsd-security@freebsd.org Subject: Re: Non-executable stack Message-ID: <86sluchf4i.fsf@xps.des.no> In-Reply-To: <dke74a$ebb$2@sea.gmane.org> (martinkov@pobox.sk's message of "Fri, 04 Nov 2005 00:39:54 %2B0100") References: <200510270608.51571.db@traceroute.dk> <200510291242.16461.db@traceroute.dk> <20051029131519.GA22254@ada.devbox.be> <200510291412.57656.db@traceroute.dk> <86pspjz0xu.fsf@xps.des.no> <43690E40.5040705@elischer.org> <dke74a$ebb$2@sea.gmane.org>
next in thread | previous in thread | raw e-mail | index | archive | help
martinko <martinkov@pobox.sk> writes: > and what exactly is that trampoline btw/pls ? When a process receives a signal, the kernel needs to call the appropriate signal handler (in user space), then do some cleanup when the signal handler returns, and pass control back to whatever code was interrupted by the signal. The cleanup is handled by the sigreturn() syscall. To avoid having to manually add a call to sigreturn() at the end of each signal handler, we use a small piece of trampoline code (sigcode in locore.S) which calls the signal handler, then issues a sigreturn() syscall. This trampoline needs to be in a fixed location so the kernel knows where to find it, and it needs to be present at all times, so we can't just put it in the crt and then have the crt report its location to the kernel somehow. Currently, it is copied into place at the top of the stack by execve(). DES -- Dag-Erling Smørgrav - des@des.no
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86sluchf4i.fsf>
