Re: doaccept() & NET_LOCK() recursion

2018-05-21 Thread Alexander Bluhm
On Mon, May 21, 2018 at 03:14:45PM +0200, Martin Pieuchot wrote: > On 21/05/18(Mon) 14:18, Alexander Bluhm wrote: > > On Mon, May 21, 2018 at 01:41:45PM +0200, Martin Pieuchot wrote: > > > Diff below fixes that, ok? > > > > This part modifies the struct socket. It would run without > > netlock

Re: doaccept() & NET_LOCK() recursion

2018-05-21 Thread Martin Pieuchot
On 21/05/18(Mon) 14:18, Alexander Bluhm wrote: > On Mon, May 21, 2018 at 01:41:45PM +0200, Martin Pieuchot wrote: > > Diff below fixes that, ok? > > This part modifies the struct socket. It would run without > netlock in your diff. Indeed, updated diff. Index: kern/uipc_syscalls.c

Re: doaccept() & NET_LOCK() recursion

2018-05-21 Thread Alexander Bluhm
On Mon, May 21, 2018 at 01:41:45PM +0200, Martin Pieuchot wrote: > Diff below fixes that, ok? This part modifies the struct socket. It would run without netlock in your diff. if (nflag & FNONBLOCK) so->so_state |= SS_NBIO; else

doaccept() & NET_LOCK() recursion

2018-05-21 Thread Martin Pieuchot
FILE_SET_MATURE() shouldn't be called while holding the NET_LOCK(). Because if it releases the last reference of a file it will call soclose() and try to grab the lock again. I posted a regression test in the following thread: https://marc.info/?l=openbsd-tech=152637351632752=2 Diff