]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: lpfc: Use memcpy() for BIOS version
authorDaniel Wagner <wagi@kernel.org>
Wed, 9 Apr 2025 11:34:22 +0000 (13:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:32 +0000 (11:05 +0100)
commitd34f2384d6df11a6c67039b612c2437f46e587e8
tree92917764cc343ebbddae4c49a89c8311756621f4
parenteb295874a43c584532c331f18c4e42b5e68afa09
scsi: lpfc: Use memcpy() for BIOS version

[ Upstream commit ae82eaf4aeea060bb736c3e20c0568b67c701d7d ]

The strlcat() with FORTIFY support is triggering a panic because it
thinks the target buffer will overflow although the correct target
buffer size is passed in.

Anyway, instead of memset() with 0 followed by a strlcat(), just use
memcpy() and ensure that the resulting buffer is NULL terminated.

BIOSVersion is only used for the lpfc_printf_log() which expects a
properly terminated string.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Link: https://lore.kernel.org/r/20250409-fix-lpfc-bios-str-v1-1-05dac9e51e13@kernel.org
Reviewed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_sli.c