linux/drivers/nvme/target
Josh Poimboeuf 1adc93a525 objtool, nvmet: Fix out-of-bounds stack access in nvmet_ctrl_state_show()
[ Upstream commit 107a23185d ]

The csts_state_names[] array only has six sparse entries, but the
iteration code in nvmet_ctrl_state_show() iterates seven, resulting in a
potential out-of-bounds stack read.  Fix that.

Fixes the following warning with an UBSAN kernel:

  vmlinux.o: warning: objtool: .text.nvmet_ctrl_state_show: unexpected end of section

Fixes: 649fd41420 ("nvmet: add debugfs support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/f1f60858ee7a941863dc7f5506c540cb9f97b5f6.1742852847.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202503171547.LlCTJLQL-lkp@intel.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-04-10 14:39:26 +02:00
..
admin-cmd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
auth.c block-6.12-20241101 2024-11-01 13:41:55 -10:00
configfs.c nvmet: Don't overflow subsysnqn 2025-01-09 13:33:40 +01:00
core.c for-6.11/block-20240710 2024-07-15 14:20:22 -07:00
debugfs.c objtool, nvmet: Fix out-of-bounds stack access in nvmet_ctrl_state_show() 2025-04-10 14:39:26 +02:00
debugfs.h nvmet: add debugfs support 2024-06-24 12:53:42 -07:00
discovery.c nvme: rename CDR/MORE/DNR to NVME_STATUS_* 2024-06-24 12:53:42 -07:00
fabrics-cmd-auth.c for-6.11/block-20240710 2024-07-15 14:20:22 -07:00
fabrics-cmd.c for-6.11/block-20240710 2024-07-15 14:20:22 -07:00
fc.c for-6.11/block-20240710 2024-07-15 14:20:22 -07:00
fcloop.c nvme-fcloop: implement 'host_traddr' 2024-06-24 12:53:43 -07:00
io-cmd-bdev.c nvmet: propagate npwg topology 2025-01-23 17:22:57 +01:00
io-cmd-file.c nvmet: use bvec_set_page to initialize bvecs 2023-02-03 08:20:55 -07:00
Kconfig nvmet: add debugfs support 2024-06-24 12:53:42 -07:00
loop.c nvme-loop: flush off pending I/O while shutting down loop controller 2024-10-17 11:07:37 -07:00
Makefile nvmet: add debugfs support 2024-06-24 12:53:42 -07:00
nvmet.h nvmet: add 'host_traddr' callback for debugfs 2024-06-24 12:53:43 -07:00
passthru.c nvmet-passthru: clear EUID/NGUID/UUID while using loop target 2024-10-01 11:08:40 -07:00
rdma.c nvmet-rdma: recheck queue state is LIVE in state lock in recv done 2025-03-22 12:54:19 -07:00
tcp.c nvmet-tcp: Fix a possible sporadic response drops in weakly ordered arch 2025-03-13 13:02:03 +01:00
trace.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
trace.h nvme: trace: avoid memcpy overflow warning 2024-01-05 13:16:18 -08:00
zns.c nvme: rename CDR/MORE/DNR to NVME_STATUS_* 2024-06-24 12:53:42 -07:00