diff options
author | Konstantin Shelekhin <k.shelekhin@yadro.com> | 2023-07-22 18:26:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-09-23 10:48:17 +0200 |
commit | 114b44dddea1f8f99576de3c0e6e9059012002fc (patch) | |
tree | d4ae3b22c7d4a4beade8a9a7b9cf5fca0f01069c /lib/kobject.c | |
parent | 2ce38bd3e9724502632957feeee11958cfee4f99 (diff) |
scsi: target: iscsi: Fix buffer overflow in lio_target_nacl_info_show()
[ Upstream commit 801f287c93ff95582b0a2d2163f12870a2f076d4 ]
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>
Diffstat (limited to 'lib/kobject.c')
0 files changed, 0 insertions, 0 deletions