CVE-2022-49297 Information
Description
In the Linux kernel the following vulnerability has been resolved:
nbd: fix io hung while disconnecting device
In our tests \qemu-nbd\ triggers a io hung:
INFO: task qemu-nbd:11445 blocked for more than 368 seconds.
Not tainted 5.18.0-rc3-next-20220422-00003-g2176915513ca 884
cho 0 > /proc/sys/kernel/hung_task_timeout_secs\ disables this message.
task:qemu-nbd state:D stack: 0 pid:11445 ppid: 1 flags:0x00000000
Call Trace:
\qemu-ndb -d\ will call ioctl ‘NBD_DISCONNECT’ first however following message was found:
block nbd0: Send disconnect failed -32
Which indicate that something is wrong with the server. Then \qemu-nbd -d\ will call ioctl ‘NBD_CLEAR_SOCK’ however ioctl can’t clear requests after commit 2516ab1543fd( bd: only clear the queue on device teardown). And in the meantime request can’t complete through timeout because nbd_xmit_timeout() will always return ‘BLK_EH_RESET_TIMER’ which means such request will never be completed in this situation.
Now that the flag ‘NBD_CMD_INFLIGHT’ can make sure requests won’t complete multiple times switch back to call nbd_clear_sock() in nbd_clear_sock_ioctl() so that inflight requests can be cleared.
Reference
https://git.kernel.org/stable/c/09dadb5985023e27d4740ebd17e6fea4640110e5 https://git.kernel.org/stable/c/141318e62db87105b0103fccc59c9c5940da248d https://git.kernel.org/stable/c/54b06dc2a206b4d67349bb56b92d4bd32700b7b1 https://git.kernel.org/stable/c/62d227f67a8c25d5e16f40e5290607f9306d2188 https://git.kernel.org/stable/c/67e403136a0e1a55fef6a05f103a3979a39ad3fd https://git.kernel.org/stable/c/69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd https://git.kernel.org/stable/c/c4ba982bd5084fa659ef518aaf159e4dab02ecda https://git.kernel.org/stable/c/f72df77600a43e59b3189e53b47f8685739867d3
Share on: