summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorShivam Kumar <kumar.shivam43666@gmail.com>2026-03-19 01:56:58 +0300
committerKeith Busch <kbusch@kernel.org>2026-04-07 17:25:50 +0300
commit4606467a75cfc16721937272ed29462a750b60c8 (patch)
treee4fbaff265d6e1f0db7403166df7d18a89d90259 /include/linux
parente9b004ff83067cdf96774b45aea4b239ace99a2f (diff)
downloadlinux-4606467a75cfc16721937272ed29462a750b60c8.tar.xz
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(). Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Shivam Kumar <kumar.shivam43666@gmail.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions