1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00
freebsd/lib/libthr
Konstantin Belousov 066d836b02 Current pselect(3) is implemented in usermode and thus vulnerable to
well-known race condition, which elimination was the reason for the
function appearance in first place. If sigmask supplied as argument to
pselect() enables a signal, the signal might be delivered before thread
called select(2), causing lost wakeup. Reimplement pselect() in kernel,
making change of sigmask and sleep atomic.

Since signal shall be delivered to the usermode, but sigmask restored,
set TDP_OLDMASK and save old mask in td_oldsigmask. The TDP_OLDMASK
should be cleared by ast() in case signal was not gelivered during
syscall execution.

Reviewed by:	davidxu
Tested by:	pho
MFC after:	1 month
2009-10-27 10:55:34 +00:00
..
arch Implement _umtx_op_err() for ia64. 2009-10-24 20:07:17 +00:00
support
sys
thread Current pselect(3) is implemented in usermode and thus vulnerable to 2009-10-27 10:55:34 +00:00
libthr.3
Makefile Turn on nodelete linker flag because libthr can not be unloaded safely, 2009-03-31 02:50:18 +00:00
pthread.map Make openat(2) a cancellation point. 2009-10-11 20:19:45 +00:00