aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/core
diff options
context:
space:
mode:
authorAzeem Shaikh <azeemshaikh38@gmail.com>2023-07-03 18:12:56 +0000
committerKalle Valo <kvalo@kernel.org>2023-08-02 13:09:41 +0300
commitd6b484b5cb2a7d509b36a220911509ddd8b777c4 (patch)
treeedd1eb24d6af2f791dffd67c38793acaa765ee4f /net/core
parentMerge tag 'mt76-for-kvalo-2023-07-31' of https://github.com/nbd168/wireless (diff)
downloadwireguard-linux-d6b484b5cb2a7d509b36a220911509ddd8b777c4.tar.xz
wireguard-linux-d6b484b5cb2a7d509b36a220911509ddd8b777c4.zip
wifi: mt76: 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 DEV_ASSIGN is only used by TRACE macros and the return values are ignored. [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> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20230703181256.3712079-1-azeemshaikh38@gmail.com
Diffstat (limited to 'net/core')
0 files changed, 0 insertions, 0 deletions