]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: verify socket is supported during setup
authorMike Christie <mchristi@redhat.com>
Thu, 17 Oct 2019 21:27:34 +0000 (16:27 -0500)
committerJens Axboe <axboe@kernel.dk>
Fri, 25 Oct 2019 20:37:21 +0000 (14:37 -0600)
commit9ddf12ad54bfe44c472b9ffdda13adadfd9b58b8
tree75be589c2bcf36be09c34b8f642c0e0e8b84a61a
parent0de2194210f33ca6d7713c416ff0c23c26e166ae
nbd: verify socket is supported during setup

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: 0f7abac3d749 ("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>
drivers/block/nbd.c