# CVE-2022-49297: nbd: fix io hung while disconnecting device

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-02-26T02:01:26.628Z
- **Modified:** 2026-06-17T05:17:38.123Z

## Who should check

- Anyone running Linux \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 67e403136a0e1a55fef6a05f103a3979a39ad3fd; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 62d227f67a8c25d5e16f40e5290607f9306d2188; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< f72df77600a43e59b3189e53b47f8685739867d3; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< c4ba982bd5084fa659ef518aaf159e4dab02ecda; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 54b06dc2a206b4d67349bb56b92d4bd32700b7b1; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 141318e62db87105b0103fccc59c9c5940da248d; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 09dadb5985023e27d4740ebd17e6fea4640110e5
- Anyone running Linux 4.12

## 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
"echo 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:
 \<TASK\>
 \_\_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: 000000000000000f
RBP: 000000000000000f R08: 000000000000fbe8 R09: 000055fe497c62b0
R10: 00000002aff20000 R11: 0000000000000246 R12: 000000000000006d
R13: 0000000000000000 R14: 00007ffe82dc5e70 R15: 00007fd8fcdff9c0

"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("nbd: 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.

## Affected and fixed versions

- Linux: \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 67e403136a0e1a55fef6a05f103a3979a39ad3fd; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 62d227f67a8c25d5e16f40e5290607f9306d2188; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< f72df77600a43e59b3189e53b47f8685739867d3; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< c4ba982bd5084fa659ef518aaf159e4dab02ecda; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 54b06dc2a206b4d67349bb56b92d4bd32700b7b1; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 141318e62db87105b0103fccc59c9c5940da248d; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 09dadb5985023e27d4740ebd17e6fea4640110e5 (cvelist)
- Linux: 4.12 (cvelist)

## Mitigation

- Upgrade Linux to 09dadb5985023e27d4740ebd17e6fea4640110e5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49297. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49297.md
Affected: Linux >= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, < 67e403136a0e1a55fef6a05f103a3979a39ad3fd; >= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, < 62d227f67a8c25d5e16f40e5290607f9306d2188; >= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, < 69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd; >= 2516ab1543fdd1f9d08385d…
Fixed in: Linux 67e403136a0e1a55fef6a05f103a3979a39ad3fd, Linux 62d227f67a8c25d5e16f40e5290607f9306d2188, Linux 69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd, Linux 54b06dc2a206b4d67349bb56b92d4bd32700b7b1, Linux 141318e62db87105b0103fccc59c9c5940da248d, Linux 09dadb5985023e27d4740ebd17e6fea4640110e5

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49297 being exploited?

There is no confirmed exploitation: CVE-2022-49297 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49297?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49297?

Linux \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 67e403136a0e1a55fef6a05f103a3979a39ad3fd; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 62d227f67a8c25d5e16f40e5290607f9306d2188; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< f72df77600a43e59b3189e53b47f8685739867d3; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< c4ba982bd5084fa659ef518aaf159e4dab02ecda; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 54b06dc2a206b4d67349bb56b92d4bd32700b7b1; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 141318e62db87105b0103fccc59c9c5940da248d; \>= 2516ab1543fdd1f9d08385d73cae51f668a9f3dc, \< 09dadb5985023e27d4740ebd17e6fea4640110e5; Linux 4.12.

### Is there a fix for CVE-2022-49297?

Yes. Fixed in Linux 67e403136a0e1a55fef6a05f103a3979a39ad3fd, Linux 62d227f67a8c25d5e16f40e5290607f9306d2188, Linux 69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd, Linux 54b06dc2a206b4d67349bb56b92d4bd32700b7b1, Linux 141318e62db87105b0103fccc59c9c5940da248d, Linux 09dadb5985023e27d4740ebd17e6fea4640110e5. Upgrade Linux to 09dadb5985023e27d4740ebd17e6fea4640110e5 or later.

### How do I check if I'm affected by CVE-2022-49297?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/67e403136a0e1a55fef6a05f103a3979a39ad3fd>
- patch: <https://git.kernel.org/stable/c/62d227f67a8c25d5e16f40e5290607f9306d2188>
- patch: <https://git.kernel.org/stable/c/69893d6d7f5c10d8306c1b5fc64b71efc91aa6cd>
- patch: <https://git.kernel.org/stable/c/f72df77600a43e59b3189e53b47f8685739867d3>
- patch: <https://git.kernel.org/stable/c/c4ba982bd5084fa659ef518aaf159e4dab02ecda>
- patch: <https://git.kernel.org/stable/c/54b06dc2a206b4d67349bb56b92d4bd32700b7b1>
- patch: <https://git.kernel.org/stable/c/141318e62db87105b0103fccc59c9c5940da248d>
- patch: <https://git.kernel.org/stable/c/09dadb5985023e27d4740ebd17e6fea4640110e5>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49297>

HTML: <https://flawdb.com/CVE-2022-49297> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49297>
