]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 13 Nov 2019 23:47:34 +0000 (18:47 -0500)
commit6432a99106b9df6e223aa3070d03b0490ec20e33
tree482c221dd4007b7a557fd88d595d260dc7dff4d9
parent0db078d4af745d0b0c0cf86aaf192af1a6638b93
nbd: verify socket is supported during setup

BugLink: https://bugs.launchpad.net/bugs/1852492
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/block/nbd.c