WSL2-Linux-Kernel/drivers/target/iscsi
Konstantin Shelekhin 5353df78c2 scsi: target: iscsi: Fix buffer overflow in lio_target_nacl_info_show()
[ Upstream commit 801f287c93 ]

The function lio_target_nacl_info_show() uses sprintf() in a loop to print
details for every iSCSI connection in a session without checking for the
buffer length. With enough iSCSI connections it's possible to overflow the
buffer provided by configfs and corrupt the memory.

This patch replaces sprintf() with sysfs_emit_at() that checks for buffer
boundries.

Signed-off-by: Konstantin Shelekhin <k.shelekhin@yadro.com>
Link: https://lore.kernel.org/r/20230722152657.168859-2-k.shelekhin@yadro.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:09:59 +02:00
..
cxgbit
Kconfig
Makefile
iscsi_target.c scsi: target: iscsit: Free cmds before session free 2023-05-24 17:36:45 +01:00
iscsi_target.h
iscsi_target_auth.c
iscsi_target_auth.h
iscsi_target_configfs.c scsi: target: iscsi: Fix buffer overflow in lio_target_nacl_info_show() 2023-09-23 11:09:59 +02:00
iscsi_target_datain_values.c
iscsi_target_datain_values.h
iscsi_target_device.c
iscsi_target_device.h
iscsi_target_erl0.c
iscsi_target_erl0.h
iscsi_target_erl1.c
iscsi_target_erl1.h
iscsi_target_erl2.c
iscsi_target_erl2.h
iscsi_target_login.c
iscsi_target_login.h
iscsi_target_nego.c scsi: target: iscsi: Prevent login threads from racing between each other 2023-06-28 10:29:50 +02:00
iscsi_target_nego.h
iscsi_target_nodeattrib.c
iscsi_target_nodeattrib.h
iscsi_target_parameters.c
iscsi_target_parameters.h
iscsi_target_seq_pdu_list.c
iscsi_target_seq_pdu_list.h
iscsi_target_stat.c
iscsi_target_tmr.c
iscsi_target_tmr.h
iscsi_target_tpg.c
iscsi_target_tpg.h
iscsi_target_transport.c
iscsi_target_util.c
iscsi_target_util.h