Commit 3353c04d authored by Laura Abbott's avatar Laura Abbott Committed by Greg Kroah-Hartman
Browse files

scsi: ibmvscsis: Ensure partition name is properly NUL terminated

[ Upstream commit adad633a


While reviewing another part of the code, Kees noticed that the strncpy of the
partition name might not always be NUL terminated. Switch to using strscpy
which does this safely.
Reported-by: default avatarKees Cook <>
Signed-off-by: default avatarLaura Abbott <>
Reviewed-by: default avatarKees Cook <>
Signed-off-by: default avatarMartin K. Petersen <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 40e49c15
......@@ -3468,7 +3468,7 @@ static int ibmvscsis_probe(struct vio_dev *vdev,
snprintf(vscsi->eye, sizeof(vscsi->eye), "VSCSI %s", vdev->name);
vscsi->dds.unit_id = vdev->unit_address;
strncpy(vscsi->dds.partition_name, partition_name,
strscpy(vscsi->dds.partition_name, partition_name,
vscsi->dds.partition_num = partition_number;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment