diff options
author | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2023-03-06 04:13:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-22 15:37:50 +0300 |
commit | 8ed9813871038b25a934b21ab76b5b7dbf44fc3a (patch) | |
tree | 7e97b7cd86ea53db0004b05557070772a7e6ba97 /drivers/pwm/pwm-twl-led.c | |
parent | e40a30a96252a47b5840e8844db5d5f347e30f32 (diff) | |
download | linux-8ed9813871038b25a934b21ab76b5b7dbf44fc3a.tar.xz |
nvmet: avoid potential UAF in nvmet_req_complete()
[ Upstream commit 6173a77b7e9d3e202bdb9897b23f2a8afe7bf286 ]
An nvme target ->queue_response() operation implementation may free the
request passed as argument. Such implementation potentially could result
in a use after free of the request pointer when percpu_ref_put() is
called in nvmet_req_complete().
Avoid such problem by using a local variable to save the sq pointer
before calling __nvmet_req_complete(), thus avoiding dereferencing the
req pointer after that function call.
Fixes: a07b4970f464 ("nvmet: add a generic NVMe target")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/pwm/pwm-twl-led.c')
0 files changed, 0 insertions, 0 deletions