]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kern: never restart syscalls calling closefp(), e.g. close(2)
authorKyle Evans <kevans@FreeBSD.org>
Wed, 25 Nov 2020 01:08:57 +0000 (01:08 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Wed, 25 Nov 2020 01:08:57 +0000 (01:08 +0000)
commitc7ef3490e255f820b2be4e7068965f95b9398d9a
tree18a79862d94974eff2815db758c6648ac893e9b6
parent688f8b822cea550753e7f3495339141cb6b565b7
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

Reviewed by: jilles, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27310
sys/kern/kern_descrip.c