mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-22 03:53:43 +00:00
hns3_dbg_fill_content()/hclge_dbg_fill_content() is aim to integrate some
items to a string for content, and we add '\n' and '\0' in the last
two bytes of content.
strscpy() will add '\0' in the last byte of destination buffer(one of
items), it result in finishing content print ahead of schedule and some
dump content truncation.
One Error log shows as below:
cat mac_list/uc
UC MAC_LIST:
Expected:
UC MAC_LIST:
FUNC_ID MAC_ADDR STATE
pf 00:2b:19:05:03:00 ACTIVE
The destination buffer is length-bounded and not required to be
NUL-terminated, so just change strscpy() to memcpy() to fix it.
Fixes:
|
||
|---|---|---|
| .. | ||
| hns3_common | ||
| hns3pf | ||
| hns3vf | ||
| hclge_mbx.h | ||
| hnae3.c | ||
| hnae3.h | ||
| hns3_dcbnl.c | ||
| hns3_debugfs.c | ||
| hns3_debugfs.h | ||
| hns3_enet.c | ||
| hns3_enet.h | ||
| hns3_ethtool.c | ||
| hns3_ethtool.h | ||
| hns3_trace.h | ||
| Makefile | ||