1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/lib
Ralph Boehme 19b193ebc9 tdb: runtime check for robust mutexes may hang in threaded programs
The current runtime check for robust mutexes in
tdb_runtime_check_for_robust_mutexes() is not thread-safe.

When called in a multi-threaded program where any another thread doesn't
have SIGCHLD blocked, we may end up hung in sigsuspend() waiting for a
SIGCHLD of a child procecss and the signal was delivered to another
thread.

Revert to the previous behaviour of waiting for the child instead of
waiting for the SIGCHLD signal.

Ensure the pid we wait for is not reset to -1 in a toctou race with the
signal handler.

Check whether waitpid() returns ECHILD which can happen if the signal
handler is run by more then one thread in parallel (yes, this can
happen) or if tdb_robust_mutex_wait_for_child() and the signal handler
are racing.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12593

Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-04-27 14:52:16 +02:00
..
addns wscript: remove executable bits for all wscript* files 2017-01-11 20:21:01 +01:00
afs waf: add --with-fake-kaserver option 2014-06-04 20:09:38 +02:00
async_req lib/async_req: add writev_cancel() 2016-10-26 11:20:12 +02:00
compression lib/compression/tests: add missing #include "torture/local/proto.h" 2014-04-02 09:03:44 +02:00
crypto lib/crypto: implement samba.crypto Python module for RC4 2017-03-15 01:30:24 +01:00
dbwrap dbwrap: add dbwrap_parse_record_send/recv 2017-04-18 22:54:16 +02:00
krb5_wrap krb5_wrap: Fix smb_gss_krb5_import_cred() picky-developer build 2017-03-14 15:22:12 +01:00
ldb ldb:tests: Unit test the ldb_rename() operation 2017-04-19 15:46:26 +02:00
ldb-samba python: samba._ldb: Port of samba._ldb to Python 3 compatible form 2017-03-10 07:31:11 +01:00
nss_wrapper nss_wrapper: use conf.blddir to construct libnss_wrapper_so_path 2017-04-07 10:32:13 +02:00
pam_wrapper lib: Add pam_wrapper 1.0.3 2017-04-07 10:32:13 +02:00
param lib: param: Remove lpcfg_register_defaults_hook(). 2017-04-18 22:54:15 +02:00
pthreadpool lib/pthreadpool: fix a memory leak 2017-03-10 22:06:02 +01:00
replace replace: Fix compiler warning flag 2017-03-16 20:30:19 +01:00
resolv_wrapper resolv_wrapper: use conf.blddir to construct libnss_wrapper_so_path 2017-04-07 10:32:13 +02:00
smbconf Correct "occured" typos. 2017-02-22 08:26:21 +01:00
socket Add explicit dependency on samba-debug from libinterfaces and libserverrole. 2017-01-23 08:26:43 +01:00
socket_wrapper swrap: Build socket_wrapper path relative to blddir 2016-07-11 12:19:13 +02:00
talloc waf: disable-python - align talloc's wscript 2017-03-10 07:31:12 +01:00
tdb tdb: runtime check for robust mutexes may hang in threaded programs 2017-04-27 14:52:16 +02:00
tdb_wrap tdb_wrap: Use a struct initializer 2015-07-23 14:39:18 +02:00
tdr lib: Fix 1354521 Unchecked return value 2016-03-01 21:49:44 +01:00
tevent waf: disable-python - align tevent wscript 2017-03-10 07:31:12 +01:00
texpect texpect: undefined symbol rep_fprintf 2015-10-22 14:28:17 +02:00
torture torture: add torture_assert_mem_not_equal_goto() 2017-03-26 19:42:16 +02:00
tsocket tsocket: Do not dereference a NULL pointer 2016-06-30 02:53:01 +02:00
uid_wrapper uid_wrapper: use conf.blddir to construct libnss_wrapper_so_path 2017-04-07 10:32:13 +02:00
util lib/util: fix a Coverity finding in tfork 2017-04-25 19:14:11 +02:00
README
wscript_build Remove 'external' python module support code - use the third_party directory instead. 2015-03-06 04:41:48 +01:00

compression - Various compression algorithms (MSZIP, lzxpress)
dnspython - Python module for working with DNS.
nss_wrapper - Wrapper for the user and group NSS API allowing the use 
              of other data sources.
popt - Command-line option parsing library
replace - Provides replacements for standard (POSIX, C99) functions 
          not provided by the host platform.
socket_wrapper - Wrapper library allowing TCP/IP traffic to be redirected 
                 over Unix domain sockets.
subunit - Utilities and bindings for working with the Subunit test result 
          reporting protocol.
talloc - Hierarchical pool based memory allocator 
tdb - Simple but fast key/value database library, supporting multiple writers
torture - Simple unit testing helper library