summaryrefslogtreecommitdiffstats
path: root/sys/kern/syscalls.master
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-10-27 10:55:34 +0000
committerkib <kib@FreeBSD.org>2009-10-27 10:55:34 +0000
commit08e50139380f182b37e3e8f5bc7c1319119a4abd (patch)
tree707b4bb2816586b23064a94f87f2fbfdd1dc7380 /sys/kern/syscalls.master
parentce081b037e7a762f0dd090a207cafc5121f39f51 (diff)
downloadFreeBSD-src-08e50139380f182b37e3e8f5bc7c1319119a4abd.zip
FreeBSD-src-08e50139380f182b37e3e8f5bc7c1319119a4abd.tar.gz
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
Diffstat (limited to 'sys/kern/syscalls.master')
-rw-r--r--sys/kern/syscalls.master4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index f96ed79..ac64a75 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -919,5 +919,9 @@
519 AUE_PDKILL UNIMPL pdkill
520 AUE_PDGETPID UNIMPL pdgetpid
521 AUE_PDWAIT UNIMPL pdwait
+522 AUE_SELECT STD { int pselect(int nd, fd_set *in, \
+ fd_set *ou, fd_set *ex, \
+ const struct timespec *ts, \
+ const sigset_t *sm); }
; Please copy any additions and changes to the following compatability tables:
; sys/compat/freebsd32/syscalls.master
OpenPOWER on IntegriCloud