1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel/i40e
Justin Stitt be39d0a61a i40e: use scnprintf over strncpy+strncat
`strncpy` is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

Moreover, `strncat` shouldn't really be used either as per
fortify-string.h:
 * Do not use this function. While FORTIFY_SOURCE tries to avoid
 * read and write overflows, this is only possible when the sizes
 * of @p and @q are known to the compiler. Prefer building the
 * string with formatting, via scnprintf() or similar.

Instead, use `scnprintf` with "%s%s" format string. This code is now
more readable and robust.

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>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231017190411.2199743-7-jacob.e.keller@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-10-18 18:10:17 -07:00
..
i40e.h i40e: Split and refactor i40e_nvm_version_str() 2023-10-15 14:33:41 +01:00
i40e_adminq.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_adminq.h i40e: Split i40e_osdep.h 2023-10-05 09:13:43 -07:00
i40e_adminq_cmd.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_alloc.h i40e: Move memory allocation structures to i40e_alloc.h 2023-10-05 09:13:42 -07:00
i40e_client.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_common.c i40e: Refactor and rename i40e_read_pba_string() 2023-10-15 14:33:41 +01:00
i40e_dcb.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_dcb.h i40e: use int for i40e_status 2023-02-09 08:35:53 -08:00
i40e_dcb_nl.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_ddp.c i40e: use scnprintf over strncpy+strncat 2023-10-18 18:10:17 -07:00
i40e_debug.h i40e: Split i40e_osdep.h 2023-10-05 09:13:43 -07:00
i40e_debugfs.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_devids.h i40e: Add basic support for I710 devices 2022-09-06 12:49:00 -07:00
i40e_devlink.c i40e: Add PBA as board id info to devlink .info_get 2023-10-15 14:33:42 +01:00
i40e_devlink.h i40e: Add initial devlink support 2023-10-15 14:33:41 +01:00
i40e_diag.c i40e: remove i40e_status 2023-07-31 14:37:25 -07:00
i40e_diag.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_ethtool.c intel: fix format warnings 2023-10-18 18:10:17 -07:00
i40e_hmc.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_hmc.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_io.h i40e: Split i40e_osdep.h 2023-10-05 09:13:43 -07:00
i40e_lan_hmc.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_lan_hmc.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_main.c i40e: Refactor and rename i40e_read_pba_string() 2023-10-15 14:33:41 +01:00
i40e_nvm.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_prototype.h i40e: Refactor and rename i40e_read_pba_string() 2023-10-15 14:33:41 +01:00
i40e_ptp.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_register.h i40e: Refactor I40E_MDIO_CLAUSE* macros 2023-10-05 09:13:42 -07:00
i40e_trace.h i40e: add xdp_buff to i40e_ring struct 2023-03-09 13:11:24 -08:00
i40e_txrx.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_txrx.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_txrx_common.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_type.h i40e: Refactor and rename i40e_read_pba_string() 2023-10-15 14:33:41 +01:00
i40e_virtchnl_pf.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_virtchnl_pf.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_xsk.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_xsk.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
Makefile i40e: Add initial devlink support 2023-10-15 14:33:41 +01:00