linux/drivers/nvme/target
Bart Van Assche 6a02a61e81 nvmet: fix a use-after-free
Fix the following use-after-free complaint triggered by blktests nvme/004:

BUG: KASAN: user-memory-access in blk_mq_complete_request_remote+0xac/0x350
Read of size 4 at addr 0000607bd1835943 by task kworker/13:1/460
Workqueue: nvmet-wq nvme_loop_execute_work [nvme_loop]
Call Trace:
 show_stack+0x52/0x58
 dump_stack_lvl+0x49/0x5e
 print_report.cold+0x36/0x1e2
 kasan_report+0xb9/0xf0
 __asan_load4+0x6b/0x80
 blk_mq_complete_request_remote+0xac/0x350
 nvme_loop_queue_response+0x1df/0x275 [nvme_loop]
 __nvmet_req_complete+0x132/0x4f0 [nvmet]
 nvmet_req_complete+0x15/0x40 [nvmet]
 nvmet_execute_io_connect+0x18a/0x1f0 [nvmet]
 nvme_loop_execute_work+0x20/0x30 [nvme_loop]
 process_one_work+0x56e/0xa70
 worker_thread+0x2d1/0x640
 kthread+0x183/0x1c0
 ret_from_fork+0x1f/0x30

Cc: stable@vger.kernel.org
Fixes: a07b4970f4 ("nvmet: add a generic NVMe target")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2022-09-05 15:03:51 +02:00
..
admin-cmd.c nvmet: implement basic In-Band Authentication 2022-08-02 17:14:49 -06:00
auth.c nvmet-auth: add missing goto in nvmet_setup_auth() 2022-08-31 07:57:59 +03:00
configfs.c nvmet: don't check for NULL pointer before kfree in nvmet_host_release 2022-08-02 17:22:51 -06:00
core.c nvmet: fix a use-after-free 2022-09-05 15:03:51 +02:00
discovery.c nvmet: register discovery subsystem as 'current' 2021-10-27 08:06:04 +02:00
fabrics-cmd-auth.c nvmet-auth: use kmemdup instead of kmalloc + memcpy 2022-08-10 16:05:09 +02:00
fabrics-cmd.c nvmet: implement basic In-Band Authentication 2022-08-02 17:14:49 -06:00
fc.c nvmet: use a private workqueue instead of the system workqueue 2022-03-29 09:29:04 +02:00
fcloop.c nvmet: use a private workqueue instead of the system workqueue 2022-03-29 09:29:04 +02:00
io-cmd-bdev.c nvme/target: Use the new blk_opf_t type 2022-07-14 12:14:32 -06:00
io-cmd-file.c keep iocb_flags() result cached in struct file 2022-06-10 16:10:23 -04:00
Kconfig nvmet-auth: select the intended CRYPTO_DH_RFC7919_GROUPS 2022-08-02 17:22:51 -06:00
loop.c nvme-loop: use nvme core helpers to cancel all requests in a tagset 2022-08-02 17:14:47 -06:00
Makefile nvmet: implement basic In-Band Authentication 2022-08-02 17:14:49 -06:00
nvmet.h nvmet-auth: expire authentication sessions 2022-08-02 17:14:50 -06:00
passthru.c nvmet: add a clear_ids attribute for passthru targets 2022-06-30 08:23:24 +02:00
rdma.c RDMA: Split kernel-only global device caps from uverbs device caps 2022-04-06 15:02:13 -03:00
tcp.c nvmet-tcp: fix unhandled tcp states in nvmet_tcp_state_change() 2022-08-31 07:58:10 +03:00
trace.c nvmet: add set feature tracing support 2021-08-16 14:42:23 +02:00
trace.h nvmet: use min of device_path and disk len 2021-02-10 16:38:05 +01:00
zns.c nvme/target: Use the new blk_opf_t type 2022-07-14 12:14:32 -06:00