mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-29 12:28:27 +02:00
scsi: target: Do not write NUL characters into ASCII configfs output
[ Upstream commitc03b55f235] NUL characters are not allowed in ASCII configfs output. Hence this patch. Fixes:c66ac9db8d("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20251027184639.3501254-2-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e8fe1cd91e
commit
288fa0d792
@@ -2774,7 +2774,6 @@ static ssize_t target_lu_gp_members_show(struct config_item *item, char *page)
|
||||
cur_len = snprintf(buf, LU_GROUP_NAME_BUF, "%s/%s\n",
|
||||
config_item_name(&hba->hba_group.cg_item),
|
||||
config_item_name(&dev->dev_group.cg_item));
|
||||
cur_len++; /* Extra byte for NULL terminator */
|
||||
|
||||
if ((cur_len + len) > PAGE_SIZE || cur_len > LU_GROUP_NAME_BUF) {
|
||||
pr_warn("Ran out of lu_gp_show_attr"
|
||||
|
||||
Reference in New Issue
Block a user