{"id":"CVE-2022-49297","aliases":["CVE-2022-49297"],"related":[],"kind":"vulnerability","state":"published","title":"nbd: fix io hung while disconnecting device","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnbd: fix io hung while disconnecting device\n\nIn our tests, \"qemu-nbd\" triggers a io hung:\n\nINFO: task qemu-nbd:11445 blocked for more than 368 seconds.\n      Not tainted 5.18.0-rc3-next-20220422-00003-g2176915513ca #884\n\"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\" disables this message.\ntask:qemu-nbd        state:D stack:    0 pid:11445 ppid:     1 flags:0x00000000\nCall Trace:\n <TASK>\n __schedule+0x480/0x1050\n ? _raw_spin_lock_irqsave+0x3e/0xb0\n schedule+0x9c/0x1b0\n blk_mq_freeze_queue_wait+0x9d/0xf0\n ? ipi_rseq+0x70/0x70\n blk_mq_freeze_queue+0x2b/0x40\n nbd_add_socket+0x6b/0x270 [nbd]\n nbd_ioctl+0x383/0x510 [nbd]\n blkdev_ioctl+0x18e/0x3e0\n __x64_sys_ioctl+0xac/0x120\n do_syscall_64+0x35/0x80\n entry_SYSCALL_64_after_hwframe+0x44/0xae\nRIP: 0033:0x7fd8ff706577\nRSP: 002b:00007fd8fcdfebf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010\nRAX: ffffffffffffffda RBX: 0000000040000000 RCX: 00007fd8ff706577\nRDX: 000000000000000d RSI: 000000000000ab00 RDI: 000000000000000f\nRBP: 000000000000000f R08: 000000000000fbe8 R09: 000055fe497c62b0\nR10: 00000002aff20000 R11: 0000000000000246 R12: 000000000000006d\nR13: 0000000000000000 R14: 00007ffe82dc5e70 R15: 00007fd8fcdff9c0\n\n\"qemu-ndb -d\" will call ioctl 'NBD_DISCONNECT' first, however, following\nmessage was found:\n\nblock nbd0: Send disconnect failed -32\n\nWhich indicate that something is wrong with the server. Then,\n\"qemu-nbd -d\" will call ioctl 'NBD_CLEAR_SOCK', however ioctl can't clear\nrequests after commit 2516ab1543fd(\"nbd: only clear the queue on device\nteardown\"). And in the meantime, request can't complete through timeout\nbecause nbd_xmit_timeout() will always return 'BLK_EH_RESET_TIMER', which\nmeans such request will never be completed in this situation.\n\nNow that the flag 'NBD_CMD_INFLIGHT' can make sure requests won't\ncomplete multiple times, switch back to call nbd_clear_sock() in\nnbd_clear_sock_ioctl(), so that inflight requests can be cleared.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnbd: fix io hung while disconnecting device\n\nIn our tests, \"qemu-nbd\" triggers a io hung:\n\nINFO: task qemu-nbd:11445 blocked for more than 368 seconds.\n      Not tainted 5.18.0-rc3-next-20220422-00003-g2176915513ca #884\n\"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\" disables this message.\ntask:qemu-nbd        state:D stack:    0 pid:11445 ppid:     1 flags:0x00000000\nCall Trace:\n <TASK>\n __schedule+0x480/0x1050\n ? _raw_spin_lock_irqsave+0x3e/0xb0\n schedule+0x9c/0x1b0\n blk_mq_freeze_queue_wait+0x9d/0xf0\n ? ipi_rseq+0x70/0x70\n blk_mq_freeze_queue+0x2b/0x40\n nbd_add_socket+0x6b/0x270 [nbd]\n nbd_ioctl+0x383/0x510 [nbd]\n blkdev_ioctl+0x18e/0x3e0\n __x64_sys_ioctl+0xac/0x120\n do_syscall_64+0x35/0x80\n entry_SYSCALL_64_after_hwframe+0x44/0xae\nRIP: 0033:0x7fd8ff706577\nRSP: 002b:00007fd8fcdfebf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010\nRAX: ffffffffffffffda RBX: 0000000040000000 RCX: 00007fd8ff706577\nRDX: 000000000000000d RSI: 000000000000ab00 RDI: 000000000000000f\nRBP: 000000000000000f R08: 000000000000fbe8 R09: 000055fe497c62b0\nR10: 00000002aff20000 R11: 0000000000000246 R12: 000000000000006d\nR13: 0000000000000000 R14: 00007ffe82dc5e70 R15: 00007fd8fcdff9c0\n\n\"qemu-ndb -d\" will call ioctl 'NBD_DISCONNECT' first, however, following\nmessage was found:\n\nblock nbd0: Send disconnect failed -32\n\nWhich indicate that something is wrong with the server. Then,\n\"qemu-nbd -d\" will call ioctl 'NBD_CLEAR_SOCK', however ioctl can't clear\nrequests after commit 2516ab1543fd(\"nbd: only clear the queue on device\nteardown\"). And in the meantime, request can't complete through timeout\nbecause nbd_xmit_timeout() will always return 'BLK_EH_RESET_TIMER', which\nmeans such request will never be completed in this situation.\n\nNow that the flag 'NBD_CMD_INFLIGHT' can make sure requests won't\ncomplete multiple times, switch back to call nbd_clear_sock() in\nnbd_clear_sock_ioctl(), so that inflight requests can be cleared.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: nbd: se corrige el bloqueo de E/S al desconectar el dispositivo En nuestras pruebas, \"qemu-nbd\" activa un bloqueo de E/S: INFORMACIÓN: la tarea qemu-nbd:11445 estuvo bloqueada durante más de 368 segundos. No contaminada 5.18.0-rc3-next-20220422-00003-g2176915513ca #884 \"echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs\" deshabilita este mensaje. tarea:qemu-nbd estado:D pila: 0 pid:11445 ppid: 1 indicadores:0x00000000 Seguimiento de llamadas:   __schedule+0x480/0x1050 ? _raw_spin_lock_irqsave+0x3e/0xb0 schedule+0x9c/0x1b0 blk_mq_freeze_queue_wait+0x9d/0xf0 ? ipi_rseq+0x70/0x70 blk_mq_freeze_queue+0x2b/0x40 nbd_add_socket+0x6b/0x270 [nbd] nbd_ioctl+0x383/0x510 [nbd] blkdev_ioctl+0x18e/0x3e0 __x64_sys_ioctl+0xac/0x120 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fd8ff706577 RSP: 002b:00007fd8fcdfebf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000040000000 RCX: 00007fd8ff706577 RDX: 000000000000000d RSI: 000000000000ab00 RDI: 00000000000000f RBP: 00000000000000f R08: 000000000000fbe8 R09: 000055fe497c62b0 R10: 00000002aff20000 R11: 0000000000000246 R12: 0000000000000006d R13: 00000000000000000 R14: 00007ffe82dc5e70 R15: 00007fd8fcdff9c0 \"qemu-ndb -d\" llamará primero a ioctl 'NBD_DISCONNECT', sin embargo, se encontró el siguiente mensaje: block nbd0: Send desconect failed -32 Lo que indica que algo anda mal con el servidor. Luego, \"qemu-nbd -d\" llamará a ioctl 'NBD_CLEAR_SOCK', sin embargo, ioctl no puede borrar las solicitudes después de el commit 2516ab1543fd(\"nbd: solo limpia la cola al desmantelar el dispositivo\"). Mientras tanto, la solicitud no se puede completar después del tiempo de espera porque nbd_xmit_timeout() siempre devolverá 'BLK_EH_RESET_TIMER', lo que significa que dicha solicitud nunca se completará en esta situación. Ahora que el indicador 'NBD_CMD_INFLIGHT' puede garantizar que las solicitudes no se completen varias veces, vuelva a llamar a nbd_clear_sock() en nbd_clear_sock_ioctl(), de modo que las solicitudes en curso se puedan borrar.","source":"nvd"}],"published":"2025-02-26T02:01:26.628Z","modified":"2026-06-17T05:17:38.123Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"2516ab1543fdd1f9d08385d73cae51f668a9f3dc","fixed":"67e403136a0e1a55fef6a05f103a3979a39ad3fd","status":"affected"},{"type":"git","introduced":"2516ab1543fdd1f9d08385d73cae51f668a9f3dc","fixed":"62d227f67a8c25d5e16f40e5290607f9306d2188","status":"affected"},{"type":"git","introduced":"2516ab1543fdd1f9d08385d73cae51f668a9f3dc","fixed":"69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd","status":"affected"},{"type":"git","introduced":"2516ab1543fdd1f9d08385d73cae51f668a9f3dc","fixed":"f72df77600a43e59b3189e53b47f8685739867d3","status":"affected"},{"type":"git","introduced":"2516ab1543fdd1f9d08385d73cae51f668a9f3dc","fixed":"c4ba982bd5084fa659ef518aaf159e4dab02ecda","status":"affected"},{"type":"git","introduced":"2516ab1543fdd1f9d08385d73cae51f668a9f3dc","fixed":"54b06dc2a206b4d67349bb56b92d4bd32700b7b1","status":"affected"},{"type":"git","introduced":"2516ab1543fdd1f9d08385d73cae51f668a9f3dc","fixed":"141318e62db87105b0103fccc59c9c5940da248d","status":"affected"},{"type":"git","introduced":"2516ab1543fdd1f9d08385d73cae51f668a9f3dc","fixed":"09dadb5985023e27d4740ebd17e6fea4640110e5","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.12","status":"unaffected"},{"type":"semver","introduced":"4.14.283","lastAffected":"4.14.*","status":"unaffected"},{"type":"semver","introduced":"4.19.247","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.198","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.122","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.47","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.17.15","lastAffected":"5.17.*","status":"unaffected"},{"type":"semver","introduced":"5.18.4","lastAffected":"5.18.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.19","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"4.14.283"},{"status":"affected","introduced":"4.15","fixed":"4.19.247"},{"status":"affected","introduced":"4.20","fixed":"5.4.198"},{"status":"affected","introduced":"5.5","fixed":"5.10.122"},{"status":"affected","introduced":"5.11","fixed":"5.15.47"},{"status":"affected","introduced":"5.16","fixed":"5.17.15"},{"status":"affected","introduced":"5.18","fixed":"5.18.4"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/67e403136a0e1a55fef6a05f103a3979a39ad3fd","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/62d227f67a8c25d5e16f40e5290607f9306d2188","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f72df77600a43e59b3189e53b47f8685739867d3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c4ba982bd5084fa659ef518aaf159e4dab02ecda","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/54b06dc2a206b4d67349bb56b92d4bd32700b7b1","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/141318e62db87105b0103fccc59c9c5940da248d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/09dadb5985023e27d4740ebd17e6fea4640110e5","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-49297","url":"https://www.cve.org/CVERecord?id=CVE-2022-49297","licence":"CVE Terms of Use","modified":"2026-05-11T18:56:58.046Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-49297","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49297","licence":"Public domain","modified":"2026-06-17T05:17:38.123Z"}],"updatedAt":"2026-11-25T22:58:20.373Z","epss":{"score":0.00284,"percentile":0.22513,"date":"2026-12-01T12:00:22.000Z"}}