android_kernel_xiaomi_sm8350/drivers/nvme/target
Maurizio Lombardi 03e1fd0327 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: 872d26a391 ("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-09-12 11:03:56 +02:00
..
admin-cmd.c
configfs.c nvmet: fix ns enable/disable possible hang 2024-06-16 13:28:46 +02:00
core.c nvmet: remove unnecessary ctrl parameter 2023-12-08 08:44:24 +01:00
discovery.c nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery() 2019-09-12 08:50:46 -07:00
fabrics-cmd.c nvmet: nul-terminate the NQNs passed in the connect command 2023-12-08 08:44:24 +01:00
fc.c nvmet-fc: abort command when there is no binding 2024-03-01 13:13:34 +01:00
fcloop.c nvme-fcloop: fix "inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage" 2023-05-17 11:35:43 +02:00
io-cmd-bdev.c
io-cmd-file.c nvmet: use IOCB_NOWAIT only if the filesystem supports it 2021-12-01 09:23:33 +01:00
Kconfig
loop.c nvme-loop: check for NVME_LOOP_Q_LIVE in nvme_loop_destroy_admin_queue() 2021-06-18 09:58:59 +02:00
Makefile
nvmet.h nvmet: remove unnecessary ctrl parameter 2023-12-08 08:44:24 +01:00
rdma.c nvmet-rdma: fix possible bad dereference when freeing rsps 2024-09-04 13:14:57 +02:00
tcp.c nvmet-tcp: fix kernel crash if commands allocation fails 2024-09-12 11:03:56 +02:00
trace.c nvmet-trace: avoid dereferencing pointer too early 2024-09-04 13:14:54 +02:00
trace.h nvmet-trace: avoid dereferencing pointer too early 2024-09-04 13:14:54 +02:00