Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea98ab34 authored by Maurizio Lombardi's avatar Maurizio Lombardi Committed by Martin K. Petersen
Browse files

scsi: lpfc: fix potential buffer overflow.



This patch fixes a potential buffer overflow in lpfc_nvme_info_show().

Signed-off-by: default avatarMaurizio Lombardi <mlombard@redhat.com>
Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
Acked-by: default avatarJames Smart <james.smart@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent cb22bdc8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ lpfc_nvme_info_show(struct device *dev, struct device_attribute *attr,
				wwn_to_u64(vport->fc_nodename.u.wwn),
				phba->targetport->port_id);

		len += snprintf(buf + len, PAGE_SIZE,
		len += snprintf(buf + len, PAGE_SIZE - len,
				"\nNVME Target: Statistics\n");
		tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private;
		len += snprintf(buf+len, PAGE_SIZE-len,
@@ -326,7 +326,7 @@ lpfc_nvme_info_show(struct device *dev, struct device_attribute *attr,
	}
	spin_unlock_irq(shost->host_lock);

	len += snprintf(buf + len, PAGE_SIZE, "\nNVME Statistics\n");
	len += snprintf(buf + len, PAGE_SIZE - len, "\nNVME Statistics\n");
	len += snprintf(buf+len, PAGE_SIZE-len,
			"LS: Xmt %016llx Cmpl %016llx\n",
			phba->fc4NvmeLsRequests,