diff options
author | Azeem Shaikh <[email protected]> | 2023-08-31 14:36:38 +0000 |
---|---|---|
committer | Martin K. Petersen <[email protected]> | 2023-09-05 05:55:20 -0400 |
commit | 5c584fe6098ae1727650acbabdef0669cefec7be (patch) | |
tree | 2d135891fe0887cbbd6216edfad322f70a626d97 /scripts/gdb/linux/stackdepot.py | |
parent | d0b0822e32dbae80bbcb3cc86f34d28539d913df (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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/stackdepot.py')
0 files changed, 0 insertions, 0 deletions