linux/drivers/nvme/target
Leo Stone 86645d8d06 nvmet: Don't overflow subsysnqn
[ Upstream commit 4db3d750ac ]

nvmet_root_discovery_nqn_store treats the subsysnqn string like a fixed
size buffer, even though it is dynamically allocated to the size of the
string.

Create a new string with kstrndup instead of using the old buffer.

Reported-by: syzbot+ff4aab278fa7e27e0f9e@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ff4aab278fa7e27e0f9e
Fixes: 95409e277d ("nvmet: implement unique discovery NQN")
Signed-off-by: Leo Stone <leocstone@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-01-09 13:33:40 +01: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 nvmet: Make nvmet_debugfs static 2024-08-23 09:50:16 -07: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 nvme: rename CDR/MORE/DNR to NVME_STATUS_* 2024-06-24 12:53:42 -07: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 block-6.12-20241018 2024-10-18 15:53:00 -07:00
tcp.c nvmet-tcp: fix kernel crash if commands allocation fails 2024-08-26 16:00:52 -07: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