linux/drivers/message/fusion
Azeem Shaikh dbe37c71d1 scsi: message: fusion: Replace all non-returning strlcpy() with strscpy()
strlcpy() reads the entire source buffer first.  This read may exceed the
destination size limit.  This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated [1].  In an effort
to remove strlcpy() completely [2], replace strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89

Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
Link: https://lore.kernel.org/r/20230530160248.411637-1-azeemshaikh38@gmail.com
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-05-31 18:03:33 -04:00
..
lsi scsi: message: mptlan: Replace one-element array with flexible-array member 2021-04-01 23:03:10 -04:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mptbase.c scsi: message: fusion: Replace all non-returning strlcpy() with strscpy() 2023-05-31 18:03:33 -04:00
mptbase.h Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
mptctl.c scsi: message: fusion: Replace all non-returning strlcpy() with strscpy() 2023-05-31 18:03:33 -04:00
mptctl.h
mptdebug.h scsi: message: fusion: Avoid -Wempty-body warnings 2021-04-01 22:55:25 -04:00
mptfc.c scsi: message: fusion: Declare SCSI host template members const 2023-03-24 19:19:19 -04:00
mptlan.c scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition 2023-03-24 20:38:50 -04:00
mptlan.h scsi: fusion: fix if-statement empty body warning 2020-03-11 23:07:57 -04:00
mptsas.c scsi: message: fusion: Declare SCSI host template members const 2023-03-24 19:19:19 -04:00
mptsas.h scsi: message: fusion: Remove in_interrupt() usage in mptsas_cleanup_fw_event_q() 2020-12-01 00:03:54 -05:00
mptscsih.c scsi: message: fusion: Avoid flush_scheduled_work() usage 2023-03-09 21:19:31 -05:00
mptscsih.h scsi: message: fusion: Switch to attribute groups 2021-10-16 21:45:53 -04:00
mptspi.c scsi: message: fusion: Declare SCSI host template members const 2023-03-24 19:19:19 -04:00