Go to file
Stefan Liebler 9f44fa22cb Add compiler barriers around modifications of the robust mutex list for pthread_mutex_trylock. [BZ #24180]
While debugging a kernel warning, Thomas Gleixner, Sebastian Sewior and
Heiko Carstens found a bug in pthread_mutex_trylock due to misordered
instructions:
140:   a5 1b 00 01             oill    %r1,1
144:   e5 48 a0 f0 00 00       mvghi   240(%r10),0   <--- THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
14a:   e3 10 a0 e0 00 24       stg     %r1,224(%r10) <--- last THREAD_SETMEM of ENQUEUE_MUTEX_PI

vs (with compiler barriers):
140:   a5 1b 00 01             oill    %r1,1
144:   e3 10 a0 e0 00 24       stg     %r1,224(%r10)
14a:   e5 48 a0 f0 00 00       mvghi   240(%r10),0

Please have a look at the discussion:
"Re: WARN_ON_ONCE(!new_owner) within wake_futex_pi() triggerede"
(https://lore.kernel.org/lkml/20190202112006.GB3381@osiris/)

This patch is introducing the same compiler barriers and comments
for pthread_mutex_trylock as introduced for pthread_mutex_lock and
pthread_mutex_timedlock by commit 8f9450a0b7
"Add compiler barriers around modifications of the robust mutex list."

ChangeLog:

	[BZ #24180]
	* nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock):
	Add compiler barriers and comments.

(cherry picked from commit 823624bdc4)
2019-02-07 15:44:18 +01:00
argp
assert
benchtests
bits Update RWF_SUPPORTED for Linux kernel 4.16 [BZ #22947] 2018-05-10 10:56:25 +00:00
catgets
ChangeLog.old
conform conform: XFAIL siginfo_t si_band test on sparc64 2018-10-26 09:25:48 +02:00
crypt crypt: Fix badsalttest test (Bug 22765) 2018-02-01 00:02:49 -08:00
csu
ctype
debug libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 2018-06-01 10:43:06 +02:00
dirent
dlfcn malloc: tcache double free check 2018-12-12 13:22:42 +01:00
elf Fix _dl_profile_fixup data-dependency issue (Bug 23690) 2018-12-13 06:41:41 +01:00
gmon
gnulib
grp
gshadow
hesiod
hurd hurd: Fix preprocessor indentation 2018-01-29 23:00:17 +01:00
iconv
iconvdata
include Fix _dl_profile_fixup data-dependency issue (Bug 23690) 2018-12-13 06:41:41 +01:00
inet inet/tst-if_index-long: New test case for CVE-2018-19591 [BZ #23927] 2018-12-12 13:25:11 +01:00
intl intl: Do not return NULL on asprintf failure in gettext [BZ #24018] 2019-01-02 17:11:31 +01:00
io Fix a typo in a comment. 2018-03-12 19:26:40 +00:00
libidn
libio libio: Add tst-vtables, tst-vtables-interposed 2018-07-03 17:57:14 +02:00
locale Abbreviated alternative month names (%Ob) also added (bug 10871). 2018-01-22 11:26:55 +01:00
localedata es_BO locale: Change LC_PAPER to en_US (bug 22996). 2018-07-07 17:20:57 +02:00
login
mach hurd: Add expected ABI lists 2018-01-29 22:07:44 +01:00
malloc malloc: Always call memcpy in _int_realloc [BZ #24027] 2019-01-01 10:48:37 +01:00
manual malloc: tcache double free check 2018-12-12 13:22:42 +01:00
math Fix parameter type in C++ version of iseqsig (bug 23171) 2018-06-19 13:50:46 -03:00
mathvec
misc Fix misreported errno on preadv2/pwritev2 (BZ#23579) 2018-09-28 15:30:30 -03:00
nis libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
nptl Add compiler barriers around modifications of the robust mutex list for pthread_mutex_trylock. [BZ #24180] 2019-02-07 15:44:18 +01:00
nptl_db
nscd Fix multiple definitions of __nss_*_database (bug 22918) 2018-03-12 19:26:40 +00:00
nss Fix multiple definitions of __nss_*_database (bug 22918) 2018-03-12 19:26:40 +00:00
po Update translations from the Translation Project 2018-03-12 19:26:40 +00:00
posix regexec: Fix off-by-one bug in weight comparison [BZ #23036] 2018-07-11 16:43:17 +02:00
pwd
resolv Add an additional test to resolv/tst-resolv-network.c 2018-11-09 14:39:11 +01:00
resource
rt
scripts Add RISC-V to build-many-glibcs.py 2018-01-29 10:43:15 -08:00
setjmp
shadow
signal Add tst-sigaction.c to test BZ #23069 2018-04-28 13:18:25 +02:00
socket
soft-fp
stdio-common stdio-common/tst-printf.c: Remove part under a non-free license [BZ #23363] 2018-07-03 18:36:19 +02:00
stdlib Fix path length overflow in realpath [BZ #22786] 2018-05-10 10:56:25 +00:00
streams
string Add a test case for [BZ #23196] 2018-05-24 14:39:41 +02:00
sunrpc sunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166] 2018-05-15 08:21:11 +02:00
support support: Implement <support/descriptors.h> to track file descriptors 2018-12-12 13:25:07 +01:00
sysdeps x86-64 memcmp: Use unsigned Jcc instructions on size [BZ #24155] 2019-02-04 10:23:39 -08:00
sysvipc
termios
time Use _STRUCT_TIMESPEC as guard in <bits/types/struct_timespec.h> [BZ #23349] 2018-06-28 13:21:20 +02:00
timezone
wcsmbs
wctype
.gitattributes
.gitignore
abi-tags
aclocal.m4 LIBC_SLIBDIR_RTLDDIR: substitute arguments in single quotes 2018-01-25 17:20:28 +01:00
ChangeLog Add compiler barriers around modifications of the robust mutex list for pthread_mutex_trylock. [BZ #24180] 2019-02-07 15:44:18 +01:00
config.h.in Add RISC-V entries to config.h.in 2018-01-29 10:24:57 -08:00
config.make.in
configure
configure.ac
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk
INSTALL Fix typo in the previous commit 2018-01-31 23:13:00 +00:00
libc-abis
libof-iterator.mk
LICENSES stdio-common/tst-printf.c: Remove part under a non-free license [BZ #23363] 2018-07-03 18:36:19 +02:00
MAINTAINERS
Makeconfig
Makefile
Makefile.in
Makerules Allow make-link-multidir to make subdirectories 2018-01-06 23:35:46 -08:00
NEWS x86-64 memcmp: Use unsigned Jcc instructions on size [BZ #24155] 2019-02-04 10:23:39 -08:00
o-iterator.mk
README Skeleton documentation for the RISC-V port 2018-01-29 10:22:26 -08:00
Rules
shlib-versions
test-skeleton.c
version.h Update for 2.27 release 2018-02-01 16:17:18 +00:00

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.  The current
GNU/Hurd support requires out-of-tree patches that will eventually be
incorporated into an official GNU C Library release.

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
	tilegx-*-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.