Mike Christie 083322455c nbd: verify socket is supported during setup
[ Upstream commit cf1b2326b734896734c6e167e41766f9cee7686a ]

nbd requires socket families to support the shutdown method so the nbd
recv workqueue can be woken up from its sock_recvmsg call. If the socket
does not support the callout we will leave recv works running or get hangs
later when the device or module is removed.

This adds a check during socket connection/reconnection to make sure the
socket being passed in supports the needed callout.

Reported-by: syzbot+24c12fa8d218ed26011a@syzkaller.appspotmail.com
Fixes: e9e006f5fcf2 ("nbd: fix max number of supported devs")
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-06 13:06:11 +01:00
..
2019-09-06 10:21:57 +02:00
2019-09-21 07:17:14 +02:00
2018-05-11 15:08:03 -06:00
2018-06-12 16:19:22 -07:00
2017-02-20 12:16:15 +01:00
2017-08-18 08:45:29 -06:00
2018-11-13 11:08:20 -08:00
2018-06-12 16:19:22 -07:00