freebsd-dev/lib/libc
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
..
amd64 The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
arm The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
compat-43 Update the kill(2) and killpg(2) man pages to the modern permission 2012-10-22 03:37:00 +00:00
db Globally replace u_int*_t from (non-contributed) man pages. 2012-02-12 18:29:56 +00:00
gdtoa Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a 2011-11-20 14:45:42 +00:00
gen The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
gmon mdoc: end list context with El. 2012-05-12 07:52:45 +00:00
i386 The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
ia64 The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
iconv Make some tiny improvements to iconv_open(). 2013-05-25 12:13:54 +00:00
include Merge Capsicum overhaul: 2013-03-02 00:53:12 +00:00
inet A new jail(8) with a configuration file, to replace the work currently done 2010-10-19 21:32:13 +00:00
isc A new jail(8) with a configuration file, to replace the work currently done 2010-10-19 21:32:13 +00:00
locale Add <uchar.h>. 2013-05-21 19:59:37 +00:00
mips The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
nameser A new jail(8) with a configuration file, to replace the work currently done 2010-10-19 21:32:13 +00:00
net Update manpages for r250887. 2013-05-21 21:39:18 +00:00
nls POSIX 1003.1-2008: add ENOTRECOVERABLE, EOWNERDEAD errnos. 2013-05-04 19:07:22 +00:00
posix1e Fix several typos 2013-05-12 16:43:26 +00:00
powerpc The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
powerpc64 The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
quad For ARM EABI we only need a subset of the quad functions, the rest are 2013-01-19 02:33:57 +00:00
regex Fix assignment of maximum bounadary. 2013-03-01 23:26:13 +00:00
resolv Remove meaningless self-assignment in res_send.c, otherwise clang will 2011-12-15 20:10:12 +00:00
rpc Assign the len field of the netbuf structure to the current length of 2013-03-01 15:45:57 +00:00
softfloat Conditionalize the __floatunsisf and __floatunsidf functions, added in 2012-01-20 14:44:21 +00:00
sparc64 The getcontext() from the __fillcontextx() call in the 2013-05-28 04:54:16 +00:00
stdio Convert libc/stdio from K&R to ANSI C 2013-04-23 14:36:44 +00:00
stdlib Make the malloc(3) family of functions weak and make their non-weak 2013-05-25 18:59:11 +00:00
stdtime Compile contrib/tzcode/stdtime/localtime.c with -fwrapv, since it relies 2013-03-24 01:35:37 +00:00
string Create a symlink from strchrnul.3 to strchr.3. 2013-03-06 19:59:42 +00:00
sys cap_rights_limit(2): CAP_ACCEPT also permits accept4(2). 2013-05-27 21:37:19 +00:00
uuid Note that memory should be freed after uuid_to_string(3) call. 2012-03-01 14:39:01 +00:00
xdr Add a HISTORY section 2011-07-10 06:57:00 +00:00
yp libc: Use O_CLOEXEC for various internal file descriptors. 2012-09-29 11:54:34 +00:00
Makefile Disable NLS catalog use in libc if built with WITHOUT_NLS option. 2012-05-21 08:10:42 +00:00
Versions.def Add a FBSD_1.3 namespace for FreeBSD 10. 2011-10-10 15:42:33 +00:00