freebsd-dev/sys
Konstantin Belousov 28e21133f3 Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks.
If there was some error, e.g. the sleep was interrupted, as in the
referenced PR, do_rw_rdlock() did not cleared URWLOCK_READ_WAITERS.
Since unlock only wakes up write waiters when there is no read
waiters, for URWLOCK_PREFER_READER kind of locks, the result was
missed wakeups for writers.

In particular, the most visible victims are ld-elf.so locks in
processes which loaded libthr, because rtld locks are urwlocks in
prefer-reader mode.  Normal rwlocks fall into prefer-reader mode only
if thread already owns rw lock in read mode, which is not typical and
correspondingly less visible.  In the PR, unowned rtld bind lock was
waited for in the process where only one thread was left alive.

Note that do_rw_wrlock() correctly clears URWLOCK_WRITE_WAITERS in
case of errors.

Reported and tested by:	longwitz@incore.de
PR:	211947
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-25 16:35:42 +00:00
..
amd64 Make execution of 32-bit CloudABI executables work on amd64. 2016-08-24 10:51:33 +00:00
arm Add support for Allwinner A64 PLL_PERIPH0/PLL_PERIPH1 and PLL_HSIC clocks. 2016-08-25 10:29:41 +00:00
arm64 Fix an assert, it should check if, when moving from 1 l1 to 512 l2 blocks, 2016-08-25 14:42:29 +00:00
boot Don't set *dev in the zfs root case, it may be NULL and will correctly be 2016-08-25 12:42:41 +00:00
bsm
cam Make the iSCSI parameter negotiation more flexible. 2016-08-25 05:22:53 +00:00
cddl Bug 212114 - loader: zio_checksum_verify() must test spa for NULL pointer 2016-08-24 16:30:15 +00:00
compat Add missing header dependency. 2016-08-24 09:57:19 +00:00
conf Add support for Allwinner A64. 2016-08-25 13:59:19 +00:00
contrib Make execution of 32-bit CloudABI executables work on amd64. 2016-08-24 10:51:33 +00:00
crypto
ddb
dev Less-quick fix for locking fixes in r172250. r172250 added a second 2016-08-25 13:46:52 +00:00
fs Implement VOP_FDATASYNC() for msdosfs. 2016-08-15 19:17:00 +00:00
gdb
geom
gnu
i386 Convert pointers obtained from the threadattr_t structure with TO_PTR(). 2016-08-24 10:13:18 +00:00
isa
kern Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks. 2016-08-25 16:35:42 +00:00
kgssapi
libkern
mips [mips] add support for the "creative" GNU extensions and IRIX hilarity around MIPS LO16/HI16 relocations. 2016-08-21 00:48:41 +00:00
modules Add a Makefile for building the cloudabi32 kernel module. 2016-08-24 11:35:49 +00:00
net hyperv/hn: Use vmbus xact for RNDIS initialize. 2016-08-25 05:00:41 +00:00
net80211 [net80211] correctly lock the ifp before accessing the lladdr. 2016-08-18 01:25:12 +00:00
netgraph
netinet Pass the number of segments coalesced by LRO up the stack by repurposing the 2016-08-25 13:33:32 +00:00
netinet6 Fix L2 caching for UDP over IPv6 2016-08-24 00:52:30 +00:00
netipsec
netnatm
netpfil Try to fix gcc compilation errors (which are right). 2016-08-18 10:26:15 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Add support for setting blocking and non-blocking mode on /dev/rdma_cm 2016-08-18 08:49:02 +00:00
opencrypto
pc98 Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. 2016-08-20 00:49:29 +00:00
powerpc Close a race when making the CPU idle under pHyp. If an interrupt occurs 2016-08-24 16:49:14 +00:00
riscv
rpc
security Audit the accepted (or rejected) username argument to setlogin(2). 2016-08-20 20:28:08 +00:00
sparc64 Remove the wds(4) driver for the WD700 ISA SCSI HBA. 2016-08-19 21:51:42 +00:00
sys Pass the number of segments coalesced by LRO up the stack by repurposing the 2016-08-25 13:33:32 +00:00
teken
tests
tools
ufs Bug 211013 reports that a write error to a UFS filesystem running 2016-08-16 21:02:30 +00:00
vm
x86 Fix build for !SMP kernels after the Xen MSIX workaround. 2016-08-22 21:23:17 +00:00
xdr
xen
Makefile