Go to file
Carlos O'Donell 5aad5f6178 Improve DST handling (Bug 23102, Bug 21942, Bug 18018, Bug 23259).
This commit improves DST handling significantly in the following
ways: firstly is_dst () is overhauled to correctly process DST
sequences that would be accepted given the ELF gABI.  This means that
we actually now accept slightly more sequences than before.  Now we
accept $ORIGIN$ORIGIN, but in the past we accepted only $ORIGIN\0 or
$ORIGIN/..., but this kind of behaviour results in unexpected
and uninterpreted DST sequences being used as literal search paths
leading to security defects.  Therefore the first step in correcting
this defect is making is_dst () properly account for all DSTs
and making the function context free in the sense that it counts
DSTs without knowledge of path, or AT_SECURE.  Next, _dl_dst_count ()
is also simplified to count all DSTs regardless of context.
Then in _dl_dst_substitute () we reintroduce context-dependent
processing for such things as AT_SECURE handling.  At the level of
_dl_dst_substitute we can have access to things like the true start
of the string sequence to validate $ORIGIN-based paths rooted in
trusted directories.  Lastly, we tighten up the accepted sequences
in AT_SECURE, and avoid leaving known unexpanded DSTs, this is
noted in the NEWS entry.

Verified with a sequence of 68 tests on x86_64 that cover
non-AT_SECURE and AT_SECURE testing using a sysroot (requires root
to run).  The tests cover cases for bug 23102, bug 21942, bug 18018,
and bug 23259.  These tests are not yet appropriate for the glibc
regression testsuite, but with the upcoming test-in-container testing
framework it should be possible to include these tests upstream soon.

See the mailing list for the tests:
https://www.sourceware.org/ml/libc-alpha/2018-06/msg00251.html
2018-06-12 11:07:56 -04:00
argp
assert
benchtests benchtests: Catch exceptions in input arguments 2018-06-01 16:32:43 -05:00
bits hurd: Fix shmid_ds's shm_segsz field type 2018-06-02 21:52:43 +02:00
catgets
ChangeLog.old
conform hurd xfails: Add missing bug references 2018-04-20 17:14:13 +02:00
crypt
csu Avoid cancellable I/O primitives in ld.so. 2018-06-12 09:53:04 -04:00
ctype
debug libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 2018-06-01 10:41:03 +02:00
dirent Consolidate alphasort{64} and versionsort{64} implementation 2018-04-23 17:35:16 -03:00
dlfcn
elf Improve DST handling (Bug 23102, Bug 21942, Bug 18018, Bug 23259). 2018-06-12 11:07:56 -04:00
gmon
gnulib
grp
gshadow
hesiod
htl hurd: Avoid local PLT in libpthread 2018-04-03 02:56:35 +02:00
hurd hurd: Silence warning 2018-04-04 02:06:16 +02:00
iconv
iconvdata Add aliases to recognize normalized charset names (bug 19527) 2018-04-16 17:30:56 +02:00
include Avoid cancellable I/O primitives in ld.so. 2018-06-12 09:53:04 -04:00
inet Switch IDNA implementation to libidn2 [BZ #19728] [BZ #19729] [BZ #22247] 2018-05-23 15:27:24 +02:00
intl
io Avoid cancellable I/O primitives in ld.so. 2018-06-12 09:53:04 -04:00
libio libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 2018-06-01 10:41:03 +02:00
locale
localedata gd_GB, hsb_DE, wa_BE: Add alternative month names (bug 23140). 2018-06-12 01:33:55 +02:00
login
mach hurd: Add missing symbols 2018-04-04 02:17:49 +02:00
malloc malloc: harden removal from unsorted list 2018-03-14 16:25:57 -04:00
manual Add narrowing divide functions. 2018-05-17 00:40:52 +00:00
math Fix ldbl-96 fma (Inf, Inf, finite) (bug 23272). 2018-06-11 16:33:42 +00:00
mathvec
misc Implement allocate_once for atomic initialization with allocation 2018-05-23 15:27:01 +02:00
nis
nptl Avoid cancellable I/O primitives in ld.so. 2018-06-12 09:53:04 -04:00
nptl_db
nscd Switch IDNA implementation to libidn2 [BZ #19728] [BZ #19729] [BZ #22247] 2018-05-23 15:27:24 +02:00
nss
po Update translations from the Translation Project 2018-03-12 13:24:46 +00:00
posix Avoid cancellable I/O primitives in ld.so. 2018-06-12 09:53:04 -04:00
pwd
resolv Switch IDNA implementation to libidn2 [BZ #19728] [BZ #19729] [BZ #22247] 2018-05-23 15:27:24 +02:00
resource
rt hurd: Add hurd thread library 2018-04-02 01:44:14 +02:00
scripts Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
setjmp x86: Use pad in pthread_unwind_buf to preserve shadow stack register 2018-05-02 06:17:41 -07:00
shadow
signal Add tst-sigaction.c to test BZ #23069 2018-04-26 22:21:13 +02:00
socket
soft-fp Make powerpc-nofpu __sqrtsf2, __sqrtdf2 compat symbols (bug 18473). 2018-06-01 17:25:12 +00:00
stdio-common
stdlib stdlib: Additional tests need generated locale dependencies 2018-05-29 10:34:53 +02:00
streams
string Add a test case for [BZ #23196] 2018-05-23 04:00:11 -07:00
sunrpc sunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166] 2018-05-11 15:36:50 +02:00
support support: Add wrappers for pthread_barrierattr_t 2018-05-29 15:37:00 +02:00
sysdeps Avoid cancellable I/O primitives in ld.so. 2018-06-12 09:53:04 -04:00
sysvipc
termios
time Fix year 2039 bug for localtime with 64-bit time_t (bug 22639). 2018-05-18 11:57:15 +00:00
timezone
wcsmbs math: Merge strtod_nan_*.h into math-type-macros-*.h 2018-05-16 06:03:08 +02:00
wctype
.gitattributes
.gitignore
abi-tags
aclocal.m4
ChangeLog Improve DST handling (Bug 23102, Bug 21942, Bug 18018, Bug 23259). 2018-06-12 11:07:56 -04:00
config.h.in Switch IDNA implementation to libidn2 [BZ #19728] [BZ #19729] [BZ #22247] 2018-05-23 15:27:24 +02:00
config.make.in
configure
configure.ac
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk
INSTALL
libc-abis
libof-iterator.mk
LICENSES Switch IDNA implementation to libidn2 [BZ #19728] [BZ #19729] [BZ #22247] 2018-05-23 15:27:24 +02:00
MAINTAINERS
Makeconfig Add support for sqrt asm redirects 2018-03-15 19:21:35 +00:00
Makefile
Makefile.in
Makerules
NEWS Improve DST handling (Bug 23102, Bug 21942, Bug 18018, Bug 23259). 2018-06-12 11:07:56 -04:00
o-iterator.mk
README Remove tilegx port. 2018-04-27 19:11:24 +00:00
Rules
shlib-versions
test-skeleton.c
version.h

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arm-*-linux-gnueabi
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see http://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at http://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see http://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.