summaryrefslogtreecommitdiff
path: root/drivers/ufs
diff options
context:
space:
mode:
authorAzeem Shaikh <azeemshaikh38@gmail.com>2023-08-31 17:36:38 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2023-09-05 12:55:20 +0300
commit5c584fe6098ae1727650acbabdef0669cefec7be (patch)
tree2d135891fe0887cbbd6216edfad322f70a626d97 /drivers/ufs
parentd0b0822e32dbae80bbcb3cc86f34d28539d913df (diff)
downloadlinux-5c584fe6098ae1727650acbabdef0669cefec7be.tar.xz
scsi: target: Replace 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(). Direct replacement is safe here since return value of -errno is used to check for truncation instead of sizeof(dest). [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/20230831143638.232596-1-azeemshaikh38@gmail.com Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs')
0 files changed, 0 insertions, 0 deletions