]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make sendfile(SF_SYNC)'s CV wait interruptible.
authormarkj <markj@FreeBSD.org>
Tue, 28 Apr 2020 15:02:44 +0000 (15:02 +0000)
committermarkj <markj@FreeBSD.org>
Tue, 28 Apr 2020 15:02:44 +0000 (15:02 +0000)
commit7d7c4f74f0101fb84c961631eb6c8ea90a41790e
tree506ede3ec9c8499d2392e9d066780599fa5f6e45
parent277d224e0917901373cd6ed1fbbccb2058cf6b27
Make sendfile(SF_SYNC)'s CV wait interruptible.

Otherwise, since the CV is not signalled until data is drained from the
socket, it is trivial to create an unkillable process using
sendfile(SF_SYNC) and a process-private PF_LOCAL socket pair.  In
particular, the cv_wait() in sendfile() does not get interrupted until
data is drained from the receiving socket buffer.

Reported by: pho
Discussed with: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
sys/kern/kern_sendfile.c