aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/vfs.py
diff options
context:
space:
mode:
authorAzeem Shaikh <azeemshaikh38@gmail.com>2023-08-31 14:36:38 +0000
committerMartin K. Petersen <martin.petersen@oracle.com>2023-09-05 05:55:20 -0400
commit5c584fe6098ae1727650acbabdef0669cefec7be (patch)
tree2d135891fe0887cbbd6216edfad322f70a626d97 /scripts/gdb/linux/vfs.py
parentd0b0822e32dbae80bbcb3cc86f34d28539d913df (diff)
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 'scripts/gdb/linux/vfs.py')
0 files changed, 0 insertions, 0 deletions