Skip to content

Commit f06f5ac

Browse files
committed
scsi: lpfc: Terminate string in lpfc_debugfs_nvmeio_trc_write()
jira VULN-70476 cve-pre CVE-2022-50030 commit-author Dan Carpenter <dan.carpenter@oracle.com> commit 9020be1 The "mybuf" string comes from the user, so we need to ensure that it is NUL terminated. Link: https://lore.kernel.org/r/20211214070527.GA27934@kili Fixes: bd2cdd5 ("scsi: lpfc: NVME Initiator: Add debugfs support") Reviewed-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit 9020be1) Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
1 parent 08d331d commit f06f5ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/lpfc/lpfc_debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,8 +2954,8 @@ lpfc_debugfs_nvmeio_trc_write(struct file *file, const char __user *buf,
29542954
char mybuf[64];
29552955
char *pbuf;
29562956

2957-
if (nbytes > 64)
2958-
nbytes = 64;
2957+
if (nbytes > 63)
2958+
nbytes = 63;
29592959

29602960
memset(mybuf, 0, sizeof(mybuf));
29612961

0 commit comments

Comments
 (0)