glibc/sysdeps/nptl
Zack Weinberg 4e2f43f842 Use PRINTF_FORTIFY instead of _IO_FLAGS2_FORTIFY (bug 11319)
The _chk variants of all of the printf functions become much simpler.
This is the last thing that we needed _IO_acquire_lock_clear_flags2
for, so it can go as well.  I took the opportunity to make the headers
included and the names of all local variables consistent across all the
affected files.

Since we ultimately want to get rid of __no_long_double as well, it
must be possible to get all of the nontrivial effects of the _chk
functions by calling the _internal functions with appropriate flags.
For most of the __(v)xprintf_chk functions, this is covered by
PRINTF_FORTIFY plus some up-front argument checks that can be
duplicated.  However, __(v)sprintf_chk installs a custom jump table so
that it can crash instead of overflowing the output buffer.  This
functionality is moved to __vsprintf_internal, which now has a
'maxlen' argument like __vsnprintf_internal; to get the unsafe
behavior of ordinary (v)sprintf, pass -1 for that argument.

obstack_printf_chk and obstack_vprintf_chk are no longer in the same
file.

As a side-effect of the unification of both fortified and non-fortified
vdprintf initialization, this patch fixes bug 11319 for __dprintf_chk
and __vdprintf_chk, which was previously fixed only for dprintf and
vdprintf by the commit

commit 7ca890b88e
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Feb 24 16:07:57 2010 -0800

    Fix reporting of I/O errors in *dprintf functions.

This patch adds a test case to avoid regressions.

Tested for powerpc and powerpc64le.
2018-12-05 18:15:43 -02:00
..
bits Fix race in pthread_mutex_lock while promoting to PTHREAD_MUTEX_ELISION_NP [BZ #23275] 2018-10-17 12:23:04 +02:00
sys Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Implies Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
Makeconfig nptl: Move pthread_atfork to libc_nonshared.a 2018-03-01 08:18:48 +01:00
Makefile Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Subdirs Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
aio_misc.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
allocrtsig.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dl-tunables.list Mutex: Add pthread mutex tunables 2018-12-01 08:19:20 -08:00
fork.c Refactor Linux ARCH_FORK implementation 2018-03-07 17:39:40 -03:00
fork.h Refactor atfork handlers 2018-02-22 16:43:59 -03:00
futex-internal.h [BZ #20271] Add newlines in __libc_fatal calls. 2018-08-31 18:04:32 -07:00
gai_misc.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
internaltypes.h Fix comment typo 2018-05-08 14:59:13 +02:00
jmp-unwind.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
libc-lock.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
libc-lockP.h Refactor atfork handlers 2018-02-22 16:43:59 -03:00
librt-cancellation.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
lowlevellock-futex.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
lowlevellock.h Fix blocking pthread_join. [BZ #23137] 2018-05-04 10:00:59 +02:00
malloc-machine.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pthread-functions.h libc: Extend __libc_freeres framework (Bug 23329). 2018-06-29 22:39:06 -04:00
pthread.h Revert Intel CET changes to __jmp_buf_tag (Bug 22743) 2018-01-25 23:43:46 -08:00
setxid.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
shm-directory.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
stdio-lock.h Use PRINTF_FORTIFY instead of _IO_FLAGS2_FORTIFY (bug 11319) 2018-12-05 18:15:43 -02:00
tcb-offsets.h Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
threads.h Fix ISO C threads installed header and HURD assumption 2018-07-25 17:27:45 -03:00
timer_routines.h Move NPTL-specific code to NPTL-specific header 2018-02-27 00:48:24 +01:00
tst-mqueue8x.c Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
unwind-forcedunwind.c libc: Extend __libc_freeres framework (Bug 23329). 2018-06-29 22:39:06 -04:00