linux/drivers/crypto/cavium/nitrox
Justin Stitt 0da05a040d crypto: cavium/nitrox - refactor deprecated strncpy
`strncpy` is deprecated for use on NUL-terminated destination strings [1].

We know `hw.partname` is supposed to be NUL-terminated by its later use with seq_printf:
| nitrox_debugfs.c +25
|      seq_printf(s, "  Part Name: %s\n", ndev->hw.partname);

Let's prefer a more robust and less ambiguous string interface.

A suitable replacement is `strscpy` [2] due to the fact that it guarantees
NUL-termination on the destination buffer.

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
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2023-09-20 13:15:29 +08:00
..
Kconfig crypto: skcipher - rename the crypto_blkcipher module and kconfig option 2019-11-01 13:42:47 +08:00
Makefile crypto: cavium/nitrox - Added AEAD cipher support 2018-12-23 11:52:44 +08:00
nitrox_aead.c crypto: nitrox - Use request_complete helpers 2023-02-13 18:34:49 +08:00
nitrox_algs.c crypto: cavium/nitrox - Added AEAD cipher support 2018-12-23 11:52:44 +08:00
nitrox_common.h crypto: cavium/nitrox - Added AEAD cipher support 2018-12-23 11:52:44 +08:00
nitrox_csr.h crypto: cavium/nitrox - Configure asymmetric queue manager Hardware unit 2019-08-15 21:52:14 +10:00
nitrox_debugfs.c crypto: cavium/nitrox - Fix sparse warnings 2020-11-13 20:38:45 +11:00
nitrox_debugfs.h crypto: cavium/nitrox - Use the correct style for SPDX License Identifier 2019-06-13 14:31:41 +08:00
nitrox_dev.h crypto: cavium/nitrox - Add mailbox message to get mcode info in VF 2019-10-05 01:06:18 +10:00
nitrox_hal.c crypto: cavium/nitrox - refactor deprecated strncpy 2023-09-20 13:15:29 +08:00
nitrox_hal.h crypto: cavium/nitrox - Configure asymmetric queue manager Hardware unit 2019-08-15 21:52:14 +10:00
nitrox_isr.c crypto: nitrox - fix unchecked variable in nitrox_register_interrupts 2021-06-11 15:02:14 +08:00
nitrox_isr.h crypto: cavium/nitrox - Fix sparse warnings 2020-11-13 20:38:45 +11:00
nitrox_lib.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
nitrox_main.c crypto: cavium/nitrox - remove unnecessary aer.h include 2023-03-17 11:16:43 +08:00
nitrox_mbx.c crypto: nitrox - avoid double free on error path in nitrox_sriov_init() 2022-10-21 19:15:35 +08:00
nitrox_mbx.h crypto: cavium/nitrox - Use the correct style for SPDX License Identifier 2019-06-13 14:31:41 +08:00
nitrox_req.h crypto: cavium/nitrox - fix typo on crypto 2022-02-18 16:21:08 +11:00
nitrox_reqmgr.c crypto: cavium: Fix a bunch of kernel-doc related issues 2021-05-28 15:11:44 +08:00
nitrox_skcipher.c crypto: xts - drop xts_check_key() 2023-01-06 17:15:47 +08:00
nitrox_sriov.c crypto: cavium/nitrox - Configure asymmetric queue manager Hardware unit 2019-08-15 21:52:14 +10:00