linux/drivers/nvme/target
Damien Le Moal bcd535f07c nvmet: avoid potential UAF in nvmet_req_complete()
[ Upstream commit 6173a77b7e ]

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: a07b4970f4 ("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>
2023-03-22 13:33:47 +01:00
..
admin-cmd.c nvmet: use NVME_CMD_EFFECTS_CSUPP instead of open coding it 2023-01-12 12:02:42 +01:00
auth.c
configfs.c
core.c nvmet: avoid potential UAF in nvmet_req_complete() 2023-03-22 13:33:47 +01:00
discovery.c
fabrics-cmd-auth.c
fabrics-cmd.c
fc.c nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association 2023-02-22 12:59:44 +01:00
fcloop.c
io-cmd-bdev.c
io-cmd-file.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
Kconfig
loop.c nvme: consolidate setting the tagset flags 2023-02-01 08:34:43 +01:00
Makefile
nvmet.h
passthru.c
rdma.c
tcp.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
trace.c
trace.h
zns.c