* [PATCH] scsi: lpfc: fix sprintf() overflow in lpfc_display_fpin_wwpn()
@ 2021-09-16 13:22 Dan Carpenter
2021-09-16 20:22 ` James Smart
2021-09-22 4:44 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-09-16 13:22 UTC (permalink / raw)
To: James Smart, Justin Tee
Cc: Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, kernel-janitors
This scnprintf() uses the wrong limit. It should be
"LPFC_FPIN_WWPN_LINE_SZ - len" instead of LPFC_FPIN_WWPN_LINE_SZ.
Fixes: 428569e66fa7 ("scsi: lpfc: Expand FPIN and RDF receive logging")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/scsi/lpfc/lpfc_els.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index f3fc79b99165..052c0e5b1119 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -9387,7 +9387,7 @@ lpfc_display_fpin_wwpn(struct lpfc_hba *phba, __be64 *wwnlist, u32 cnt)
/* Extract the next WWPN from the payload */
wwn = *wwnlist++;
wwpn = be64_to_cpu(wwn);
- len += scnprintf(buf + len, LPFC_FPIN_WWPN_LINE_SZ,
+ len += scnprintf(buf + len, LPFC_FPIN_WWPN_LINE_SZ - len,
" %016llx", wwpn);
/* Log a message if we are on the last WWPN
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: lpfc: fix sprintf() overflow in lpfc_display_fpin_wwpn()
2021-09-16 13:22 [PATCH] scsi: lpfc: fix sprintf() overflow in lpfc_display_fpin_wwpn() Dan Carpenter
@ 2021-09-16 20:22 ` James Smart
2021-09-22 4:44 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: James Smart @ 2021-09-16 20:22 UTC (permalink / raw)
To: Dan Carpenter, James Smart, Justin Tee
Cc: Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, kernel-janitors
On 9/16/2021 6:22 AM, Dan Carpenter wrote:
> This scnprintf() uses the wrong limit. It should be
> "LPFC_FPIN_WWPN_LINE_SZ - len" instead of LPFC_FPIN_WWPN_LINE_SZ.
>
> Fixes: 428569e66fa7 ("scsi: lpfc: Expand FPIN and RDF receive logging")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/scsi/lpfc/lpfc_els.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
looks good. Thank you
Reviewed-by: James Smart <jsmart2021@gmail.com>
-- james
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: lpfc: fix sprintf() overflow in lpfc_display_fpin_wwpn()
2021-09-16 13:22 [PATCH] scsi: lpfc: fix sprintf() overflow in lpfc_display_fpin_wwpn() Dan Carpenter
2021-09-16 20:22 ` James Smart
@ 2021-09-22 4:44 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-09-22 4:44 UTC (permalink / raw)
To: Justin Tee, Dan Carpenter, James Smart
Cc: Martin K . Petersen, James E.J. Bottomley, linux-scsi,
kernel-janitors, Dick Kennedy
On Thu, 16 Sep 2021 16:22:51 +0300, Dan Carpenter wrote:
> This scnprintf() uses the wrong limit. It should be
> "LPFC_FPIN_WWPN_LINE_SZ - len" instead of LPFC_FPIN_WWPN_LINE_SZ.
>
>
Applied to 5.15/scsi-fixes, thanks!
[1/1] scsi: lpfc: fix sprintf() overflow in lpfc_display_fpin_wwpn()
https://git.kernel.org/mkp/scsi/c/cdbc16c552f2
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-22 4:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 13:22 [PATCH] scsi: lpfc: fix sprintf() overflow in lpfc_display_fpin_wwpn() Dan Carpenter
2021-09-16 20:22 ` James Smart
2021-09-22 4:44 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).