mirror of https://github.com/torvalds/linux.git
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy() in favor of this more robust and easier to understand interface. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt <justinstitt@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20231011-strncpy-drivers-net-ethernet-microchip-sparx5-sparx5_ethtool-c-v1-1-410953d07f42@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> |
||
|---|---|---|
| .. | ||
| Kconfig | ||
| Makefile | ||
| sparx5_calendar.c | ||
| sparx5_dcb.c | ||
| sparx5_ethtool.c | ||
| sparx5_fdma.c | ||
| sparx5_mactable.c | ||
| sparx5_main.c | ||
| sparx5_main.h | ||
| sparx5_main_regs.h | ||
| sparx5_netdev.c | ||
| sparx5_packet.c | ||
| sparx5_pgid.c | ||
| sparx5_phylink.c | ||
| sparx5_police.c | ||
| sparx5_pool.c | ||
| sparx5_port.c | ||
| sparx5_port.h | ||
| sparx5_psfp.c | ||
| sparx5_ptp.c | ||
| sparx5_qos.c | ||
| sparx5_qos.h | ||
| sparx5_sdlb.c | ||
| sparx5_switchdev.c | ||
| sparx5_tc.c | ||
| sparx5_tc.h | ||
| sparx5_tc_flower.c | ||
| sparx5_tc_matchall.c | ||
| sparx5_vcap_ag_api.c | ||
| sparx5_vcap_ag_api.h | ||
| sparx5_vcap_debugfs.c | ||
| sparx5_vcap_debugfs.h | ||
| sparx5_vcap_impl.c | ||
| sparx5_vcap_impl.h | ||
| sparx5_vlan.c | ||