linux-stable/drivers/dax
Justin Stitt 75b3d5dc08 dax: refactor deprecated strncpy
`strncpy` is deprecated for use on NUL-terminated destination strings [1].

We should prefer more robust and less ambiguous string interfaces.

`dax_id->dev_name` is expected to be NUL-terminated and has been zero-allocated.

A suitable replacement is `strscpy` [2] due to the fact that it
guarantees NUL-termination on the destination buffer. Moreover, due to
`dax_id` being zero-allocated the padding behavior of `strncpy` is not
needed and a simple 1:1 replacement of strncpy -> strscpy should
suffice.

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: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
2023-09-27 10:33:46 -07:00
..
hmem dax: Cleanup extra dax_region references 2023-06-23 01:03:50 -06:00
pmem dax: Kill DEV_DAX_PMEM_COMPAT 2021-11-24 19:21:35 -08:00
bus.c dax: refactor deprecated strncpy 2023-09-27 10:33:46 -07:00
bus.h dax: Cleanup extra dax_region references 2023-06-23 01:03:50 -06:00
cxl.c dax: Cleanup extra dax_region references 2023-06-23 01:03:50 -06:00
dax-private.h dax: Introduce alloc_dev_dax_id() 2023-06-23 01:03:50 -06:00
device.c mm: remove enum page_entry_size 2023-08-24 16:20:30 -07:00
Kconfig cxl for v6.3 2023-02-25 09:19:23 -08:00
kmem.c memory tier: rename destroy_memory_type() to put_memory_type() 2023-08-18 10:12:11 -07:00
Makefile cxl/dax: Create dax devices for CXL RAM regions 2023-02-10 17:33:45 -08:00
pmem.c dax: Cleanup extra dax_region references 2023-06-23 01:03:50 -06:00
super.c dax: enable dax fault handler to report VM_FAULT_HWPOISON 2023-06-26 07:54:23 -06:00