freebsd-dev/lib/libc/powerpc/gen
Konstantin Belousov 55a1911ef2 The getcontext() from the __fillcontextx() call in the
check_deferred_signal() returns twice, since handle_signal() emulates
the return from the normal signal handler by sigreturn(2)ing the
passed context.  Second return is performed on the destroyed stack
frame, because __fillcontextx() has already returned.  This causes
undefined and bad behaviour, usually the victim thread gets SIGSEGV.

Avoid nested frame and the need to return from it by doing direct call
to getcontext() in the check_deferred_signal() and using a new private
libc helper __fillcontextx2() to complement the context with the
extended CPU state if the deferred signal is still present.

The __fillcontextx() is now unused, but is kept to allow older
libthr.so to be used with the new libc.

Mark __fillcontextx() as returning twice [1].

Reported by:	pgj
Pointy hat to:	kib
Discussed with:	dim
Tested by:	pgj, dim
Suggested by:	jilles [1]
MFC after:	1 week
2013-05-28 04:54:16 +00:00
..
_ctx_start.S Mark assembler sources from libc as working with non-executable stack. 2011-01-14 11:33:40 +00:00
_set_tp.c
_setjmp.S Do not restore the register holding the TLS pointer when doing various 2012-04-11 00:00:40 +00:00
eabi.S Allow building for the PowerPC EABI by providing a dummy __eabi() 2012-05-24 20:12:46 +00:00
fabs.S Mark assembler sources from libc as working with non-executable stack. 2011-01-14 11:33:40 +00:00
flt_rounds.c Let PowerPC world optionally build with -msoft-float. For FPU-less PowerPC 2008-02-24 19:22:53 +00:00
fpgetmask.c The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-02 22:11:14 +00:00
fpgetround.c The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-02 22:11:14 +00:00
fpgetsticky.c The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-02 22:11:14 +00:00
fpsetmask.c The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-02 22:11:14 +00:00
fpsetround.c The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-02 22:11:14 +00:00
getcontextx.c The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
infinity.c
makecontext.c
Makefile.inc Allow building for the PowerPC EABI by providing a dummy __eabi() 2012-05-24 20:12:46 +00:00
setjmp.S Do not restore the register holding the TLS pointer when doing various 2012-04-11 00:00:40 +00:00
signalcontext.c
sigsetjmp.S Do not restore the register holding the TLS pointer when doing various 2012-04-11 00:00:40 +00:00
syncicache.c Fix some ifdef logic in the libc syncicache() bit that I somehow missed in the 2008-09-24 01:06:11 +00:00