freebsd-dev/lib/libc
Konstantin Belousov fda0a14f47 Make stdio deferred cancel-safe.
If used with fopen(3)/fdopen(3)-ed FILEs, stdio accurately uses
non-cancellable internal versions of the functions, i.e. it seems to
be fine with regard to cancellation.  But if the funopen(3) and
f{r,w}open(3) functions were used to open the FILE, and corresponding
user functions create cancellation points (they typically have no
other choice), then stdio code at least leaks FILE' lock.

The change installs cleanup handler which unlocks FILE.  Some minimal
restructuring of the code was required to make it use common return
place to satisfy hand-rolled pthread_cleanup_pop() requirements.

Noted by:	eugen
Reviewed by:	eugen, vangyzen
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D11246
2017-06-29 14:44:17 +00:00
..
aarch64 Decrease relative branch brittleness. 2017-06-20 07:25:38 +00:00
amd64 Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
arm Start to remove _libc_arm_fpu_present checks. We don't support the VFP on 2017-06-29 14:00:05 +00:00
capability Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
compat-43 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
db Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
gdtoa For now, compile all of contrib/gdtoa without requiring strict aliasing, 2017-02-13 20:13:29 +00:00
gen Do not leak syslog_mutex on cancellation. 2017-06-17 11:29:59 +00:00
gmon Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
i386 Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
iconv __iconv_get_list: separate .Nm entries with commas 2017-05-23 07:02:01 +00:00
include Forward compatibility for ino64. 2017-06-23 18:06:20 +00:00
inet libc: remove use of archaic __P() macro 2017-03-30 01:03:07 +00:00
isc libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
locale localeconv(3): start sentences on new lines 2017-05-23 07:09:26 +00:00
md Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
mips Replace SOFTFLOAT with __mips_soft_float, which gcc/clang define for us. 2017-03-16 21:05:21 +00:00
nameser libc: spelling fixes. 2016-04-30 01:24:24 +00:00
net Don't end up manpage titles with a full stop. 2017-05-24 21:02:53 +00:00
nls Use current locale (f.e. set by thread). It was global locale always 2016-08-24 16:44:27 +00:00
posix1e acl_to_text(3): start sentences on new lines 2017-05-23 07:12:31 +00:00
powerpc Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
powerpc64 Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
powerpcspe Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
quad Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
regex Correct an out-of-bounds read in regcomp when the RE is bad. 2017-05-02 21:20:27 +00:00
resolv Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
riscv Use unconditional jr (jump register) so cerror relocation offset fits. 2017-04-27 22:40:39 +00:00
rpc Fix use-after-free introduced in r300388. 2017-06-22 05:10:16 +00:00
secure libc: do not include <sys/types.h> where <sys/param.h> was already included 2016-04-18 21:05:15 +00:00
softfloat Add full softfloat and hardfloat support for RISC-V. 2016-11-16 15:21:32 +00:00
sparc64 Correct an misunderstanding of MDSRCS. 2017-03-02 17:07:28 +00:00
stdio Make stdio deferred cancel-safe. 2017-06-29 14:44:17 +00:00
stdlib Update jemalloc to 5.0.0. 2017-06-15 07:15:05 +00:00
stdtime Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
string Fix strcoll_l disagreeing with strxfrm by reworking the forward order case in 2017-04-16 19:12:07 +00:00
sys Implement address space guards. 2017-06-24 17:01:11 +00:00
tests tsearch_test: Test twalk & add some determinism. 2017-06-06 03:40:45 +00:00
uuid libc: replace 0 with NULL for pointers. 2016-04-10 19:33:58 +00:00
x86/sys Remove unneeded variable initialization from r314319. 2017-02-26 22:15:39 +00:00
xdr * limit size of buffers to RPC_MAXDATASIZE 2017-06-01 06:12:25 +00:00
yp Use on crypto.x and rpc.x from the source tree. 2016-06-28 19:53:16 +00:00
libc_nossp.ldscript Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
libc.ldscript
Makefile Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
Makefile.depend DIRDEPS_BUILD: Regenerate without local dependencies. 2016-02-24 17:20:11 +00:00
Versions.def Create namespace for the symbols added during 12-CURRENT cycle. 2016-08-06 13:28:58 +00:00