Files
erofs-linux/net
Jiri Bohac 01462405f0 ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg
This fixes an old regression introduced by commit
b0d0d915 (ipx: remove the BKL).

When a recvmsg syscall blocks waiting for new data, no data can be sent on the
same socket with sendmsg because ipx_recvmsg() sleeps with the socket locked.

This breaks mars-nwe (NetWare emulator):
- the ncpserv process reads the request using recvmsg
- ncpserv forks and spawns nwconn
- ncpserv calls a (blocking) recvmsg and waits for new requests
- nwconn deadlocks in sendmsg on the same socket

Commit b0d0d915 has simply replaced BKL locking with
lock_sock/release_sock. Unlike now, BKL got unlocked while
sleeping, so a blocking recvmsg did not block a concurrent
sendmsg.

Only keep the socket locked while actually working with the socket data and
release it prior to calling skb_recv_datagram().

Signed-off-by: Jiri Bohac <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2014-11-20 22:57:03 -05:00
..
2014-10-15 10:25:04 +10:30
…
…
…
…
2014-09-10 12:40:10 -07:00
…
…
2014-09-28 07:05:16 -07:00
2014-10-09 01:40:05 -04:00
2014-10-17 23:52:54 -04:00
…
2014-10-07 20:28:44 -04:00
…
…
2014-10-27 19:09:59 -04:00
…
…