nvmet-tcp: check INIT_FAILED before nvmet_req_uninit in digest error path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fda871c0ba5d2eed2cd1c881573168129da70058 · < 2ed3c9d955e8cd6361f130623baa664a75fb345f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nvmet-tcp: check INIT_FAILED before nvmet_req_uninit in digest error path
In nvmet_tcp_try_recv_ddgst(), when a data digest mismatch is detected, nvmet_req_uninit() is called unconditionally. However, if the command arrived via the nvmet_tcp_handle_req_failure() path, nvmet_req_init() had returned false and percpu_ref_tryget_live() was never executed. The unconditional percpu_ref_put() inside nvmet_req_uninit() then causes a refcount underflow, leading to a WARNING in percpu_ref_switch_to_atomic_rcu, a use-after-free diagnostic, and eventually a permanent workqueue deadlock.
Check cmd->flags & NVMET_TCP_F_INIT_FAILED before calling nvmet_req_uninit(), matching the existing pattern in nvmet_tcp_execute_request().
From the CVE record · Linux
The Linux kernel's nvmet-tcp data-digest error path can release a reference that was never acquired. If an NVMe/TCP command follows the request-initialization failure path and has a data digest mismatch, this can cause a refcount underflow and eventually a permanent workqueue deadlock. The input does not specify authentication requirements or user interaction.
Operators running the Linux kernel with nvmet-tcp should check their exposure; affected versions are not specified.