CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2017/01/23 22:44:10

Modified files:
        sys/kern       : uipc_syscalls.c 

Log message:
In accept(2) and accept4(2) allocate a new file descriptor before
checking if the socket head's queue is empty and possibly sleeping.

This way we avoid lock ordering problems as the NET_LOCK() and
fdplock() won't be held at the same time.

Note that socketpair(2) and close(2) are the two remaining syscalls
holding these locks at the same time.  They both respect the same
order: fdplock() then NET_LOCK().

Initial deadlock reported by kettenis@ and ajacoutot@.

ok bluhm@, guenther@, deraadt@

Reply via email to