OpenBSD cvs log

created 2018-12-07T00:19:21Z
begin 2018-10-25T12:00:00Z
end 2018-10-25T18:00:00Z
path src/sys
commits 1

date 2018-10-25T15:38:37Z
author visa
files src/sys/kern/uipc_syscalls.c log diff annotate
message Fix a resource leak in doaccept().

If a connection that is being accepted gets aborted early, or if the
user-supplied buffer is invalid, doaccept() leaks a socket. This is
a regression caused by r1.153 of uipc_syscalls.c.

Correct the issue by associating the socket with the file early enough.
In case soaccept() or copyaddrout() fails, the socket will be freed
as a result of the file closing. This logic was used by the pre-r1.153
code.

closef() may block, so it is hoisted outside the fdp lock.

OK bluhm@ mpi@