kernel_samsung_a53x/drivers/nvme/target
Maurizio Lombardi e7261a6c8e nvmet-tcp: fix kernel crash if commands allocation fails
[ Upstream commit 5572a55a6f830ee3f3a994b6b962a5c327d28cb3 ]

If the commands allocation fails in nvmet_tcp_alloc_cmds()
the kernel crashes in nvmet_tcp_release_queue_work() because of
a NULL pointer dereference.

  nvmet: failed to install queue 0 cntlid 1 ret 6
  Unable to handle kernel NULL pointer dereference at
         virtual address 0000000000000008

Fix the bug by setting queue->nr_cmds to zero in case
nvmet_tcp_alloc_cmd() fails.

Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:08 +01:00
..
admin-cmd.c
configfs.c nvmet: fix ns enable/disable possible hang 2024-11-19 12:27:10 +01:00
core.c nvmet: fix a possible leak when destroy a ctrl during qp establishment 2024-11-19 14:19:43 +01:00
discovery.c
fabrics-cmd.c
fc.c nvmet-fc: abort command when there is no binding 2024-11-18 22:25:33 +01:00
fcloop.c nvmet-fcloop: swap the list_add_tail arguments 2024-11-18 22:25:33 +01:00
io-cmd-bdev.c
io-cmd-file.c
Kconfig
loop.c
Makefile
nvmet.h
passthru.c
rdma.c nvmet-rdma: fix possible bad dereference when freeing rsps 2024-11-23 23:20:47 +01:00
tcp.c nvmet-tcp: fix kernel crash if commands allocation fails 2024-11-23 23:21:08 +01:00
trace.c nvmet-trace: avoid dereferencing pointer too early 2024-11-23 23:20:45 +01:00
trace.h nvmet-trace: avoid dereferencing pointer too early 2024-11-23 23:20:45 +01:00