diff options
| author | Nilay Shroff <nilay@linux.ibm.com> | 2026-11-05 17:54:55 +0530 |
|---|---|---|
| committer | Keith Busch <kbusch@kernel.org> | 2026-11-05 08:53:01 -0800 |
| commit | f33c8bc785401669b29229bcf3d0086ba9f5b87c (patch) | |
| tree | 9b6c7eabee8f955a3495814d779a9961707cb9d5 /tools/perf/scripts/python/Perf-Trace-Util | |
| parent | c92055eb22a8e135011c14c5eb40f5da0a0c8153 (diff) | |
nvmet: cache passthru reference in __nvmet_req_complete()
__nvmet_req_complete() releases the passthru reference held while
processing a passthru request. However, it currently does so after
calling ops->queue_response().
Once ops->queue_response() is called, the transport may complete and
recycle the request on another CPU. If the request is reused, its
req->p.ref_held field may be reset to false before
__nvmet_req_complete() checks it in nvmet_put_passthru_ref().
Consequently, the passthru reference may not be released, leaving
wait_for_completion(&passthru->disable_done) in
__nvmet_passthru_ctrl_disable() blocked indefinitely.
Fix this by caching the passthru pointer at the beginning of
__nvmet_req_complete(), while the request is still valid, and use
the cached pointer to release the reference after queuing the
response. This also changes nvmet_put_passthru_ref() to accept
the passthru pointer directly instead of accessing it through
the request.
Reported-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Closes: https://lore.kernel.org/all/auhpmq499RVE9YpC@shinmob/
Fixes: 5e12d81874a1 ("nvmet: fix use-after-free in passthru I/O hotpath")
Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util')
0 files changed, 0 insertions, 0 deletions
