diff options
author | 2018-10-25 15:38:37 +0000 | |
---|---|---|
committer | 2018-10-25 15:38:37 +0000 | |
commit | c255b5a5ef16048b59539ac7e0b8d3eb3153c98d (patch) | |
tree | e2d3740f9676b394687222ec4d8164b9840e0907 /lib/libc | |
parent | Add a "terminal" colour which can be used instead of "default" in style (diff) | |
download | wireguard-openbsd-c255b5a5ef16048b59539ac7e0b8d3eb3153c98d.tar.xz wireguard-openbsd-c255b5a5ef16048b59539ac7e0b8d3eb3153c98d.zip |
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@
Diffstat (limited to 'lib/libc')
0 files changed, 0 insertions, 0 deletions