]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r368006: kern: never restart syscalls calling closefp(), e.g. close(2)
authorKyle Evans <kevans@FreeBSD.org>
Fri, 4 Dec 2020 02:20:41 +0000 (02:20 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Fri, 4 Dec 2020 02:20:41 +0000 (02:20 +0000)
commit3759398cedbb056205fddb012cdcd799c96db552
tree0c8104c017ea8e93b71ca6c71ea4fc4915a3b499
parentf3d17722033b39b668e10370ccbb7d7b436a96a2
MFC r368006: kern: never restart syscalls calling closefp(), e.g. close(2)

All paths leading into closefp() will either replace or remove the fd from
the filedesc table, and closefp() will call fo_close methods that can and do
currently sleep without regard for the possibility of an ERESTART. This can
be dangerous in multithreaded applications as another thread could have
opened another file in its place that is subsequently operated on upon
restart.

The following are seemingly the only ones that will pass back ERESTART
in-tree:
- sockets (SO_LINGER)
- fusefs
- nfsclient
sys/kern/kern_descrip.c