freebsd-dev/libexec
Konstantin Belousov b88a8d3d1d Fix acquisition of nested write compat rtld locks.
Obtaining compat rtld lock in write mode sets process signal mask to
block all signals.  Previous mask is stored in the global variable
oldsigmask.  If a lock is write-locked while another lock is already
write-locked, oldsigmask is overwritten by the total mask and on the
last unlock, all signals except traps appear to be blocked.

Fix this by counting the write-lock nested level, and only storing to
oldsigmask/restoring from it at the outermost level.

Masking signals disables involuntary preemption for libc_r, and there
could be no voluntary context switches in the locked code
(dl_iterate_phdr(3) keeps a lock around user callback, but it was
added long after libc_r was renounced).  Due to this, remembering the
level in the global variable after the lock is obtained should be
safe, because no two libc_r threads can acquire different write locks
in parallel.

PR:	215826
Reported by:	kami
Tested by:	yamagi@yamagi.org (previous version)
To be reviewed by:	kan
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2017-01-10 19:26:55 +00:00
..
atf Use SRCTOP instead of the longhand version for defining the path to contrib/atf 2016-09-20 16:24:22 +00:00
atrun Add missing files to 'at' and 'rcmds' packages. 2016-02-05 03:20:27 +00:00
blacklistd-helper DIRDEPS_BUILD: Connect new directories and update dependencies. 2016-06-03 19:25:30 +00:00
bootpd Restore some comments in previous commit. 2016-04-12 18:24:02 +00:00
comsat Add META_MODE support. 2015-06-13 19:20:56 +00:00
dma Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+ 2016-08-20 16:36:05 +00:00
fingerd DIRDEPS_BUILD: Update dependencies 2016-06-14 16:55:05 +00:00
ftpd Fix build when WITHOUT_BLACKLIST=yes is specified 2016-11-12 03:07:41 +00:00
getty Missing tab. 2016-02-27 02:11:00 +00:00
hyperv META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
mail.local MFH 2016-03-02 16:14:46 +00:00
makewhatis.local Fix installation of makewhatis.local(1) since r283777. 2016-02-18 00:26:21 +00:00
mknetid Add META_MODE support. 2015-06-13 19:20:56 +00:00
pppoed Add META_MODE support. 2015-06-13 19:20:56 +00:00
rbootd rbootd: use NULL instead of zero for pointers. 2016-04-18 15:05:48 +00:00
revnetgroup Add META_MODE support. 2015-06-13 19:20:56 +00:00
rlogind DIRDEPS_BUILD: Update dependencies 2016-06-14 16:55:05 +00:00
rpc.rquotad Add META_MODE support. 2015-06-13 19:20:56 +00:00
rpc.rstatd Update dependencies after r291406 added libelf to libkvm. 2015-12-01 05:18:48 +00:00
rpc.rusersd Add META_MODE support. 2015-06-13 19:20:56 +00:00
rpc.rwalld Add META_MODE support. 2015-06-13 19:20:56 +00:00
rpc.sprayd Add META_MODE support. 2015-06-13 19:20:56 +00:00
rshd DIRDEPS_BUILD: Update dependencies 2016-06-14 16:55:05 +00:00
rtld-aout More -Wmissing-variable-declarations fixes. 2012-10-19 14:49:42 +00:00
rtld-elf Fix acquisition of nested write compat rtld locks. 2017-01-10 19:26:55 +00:00
save-entropy Add META_MODE support. 2015-06-13 19:20:56 +00:00
smrsh MFH 2016-03-02 16:14:46 +00:00
talkd Don't use high precision clock for expiration as only second portion is 2016-12-26 17:23:09 +00:00
tcpd Use LIBEXECDIR for /usr/libexec. 2015-11-26 01:14:40 +00:00
telnetd Add META_MODE support. 2015-06-13 19:20:56 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
tftp-proxy Add META_MODE support. 2015-06-13 19:20:56 +00:00
tftpd Conditionalize all code that uses tcpd.h behind LIBWRAP guard 2017-01-06 04:27:07 +00:00
ulog-helper Add META_MODE support. 2015-06-13 19:20:56 +00:00
ypxfr Reference the libc symbols ypresp_{allfn,data} instead of local symbols. 2016-10-16 19:12:22 +00:00
Makefile Separate BLACKLIST vs BLACKLIST_SUPPORT properly 2016-06-07 16:31:03 +00:00
Makefile.amd64 HYPERV isn't available on all architectures, but just on by default 2014-10-16 00:33:06 +00:00
Makefile.i386 HYPERV isn't available on all architectures, but just on by default 2014-10-16 00:33:06 +00:00
Makefile.inc
Makefile.pc98 Add an "empty" Makefile.pc98 because it doesn't need/want HYPERV. It 2014-10-16 14:08:59 +00:00