linux/drivers/cpuidle
Justin Stitt b545465e22 cpuidle: dt: Replace deprecated strncpy() with strscpy()
`strncpy` is deprecated for use on NUL-terminated destination strings [1].

We should prefer more robust and less ambiguous string interfaces.

A suitable replacement is `strscpy` [2] due to the fact that it guarantees
NUL-termination on the destination buffer. With this, we can also drop
the now unnecessary `CPUIDLE_(NAME|DESC)_LEN - 1` pieces.

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>
Link: https://lore.kernel.org/r/20230913-strncpy-drivers-cpuidle-dt_idle_states-c-v1-1-d16a0dbe5658@google.com
Signed-off-by: Kees Cook <keescook@chromium.org>
2023-09-29 14:48:31 -07:00
..
governors cpuidle: teo: Avoid unnecessary variable assignments 2023-08-23 18:25:04 +02:00
coupled.c cpuidle: coupled: Drop duplicate word from a comment 2022-08-31 20:54:01 +02:00
cpuidle-arm.c cpuidle, arch: Mark all ct_cpuidle_enter() callers __cpuidle 2023-01-13 11:48:17 +01:00
cpuidle-at91.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
cpuidle-big_little.c cpuidle, arch: Mark all ct_cpuidle_enter() callers __cpuidle 2023-01-13 11:48:17 +01:00
cpuidle-calxeda.c
cpuidle-clps711x.c
cpuidle-cps.c
cpuidle-exynos.c
cpuidle-haltpoll.c cpuidle-haltpoll: Replace default_idle() with arch_cpu_idle() 2023-01-20 17:33:52 +01:00
cpuidle-kirkwood.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
cpuidle-mvebu-v7.c cpuidle: mvebu: Fix duplicate flags assignment 2023-01-18 12:03:54 +01:00
cpuidle-powernv.c powerpc/cpuidle: Set CPUIDLE_FLAG_POLLING for snooze state 2022-12-06 23:18:19 +11:00
cpuidle-psci-domain.c cpuidle: psci: Move enabling OSI mode after power domains creation 2023-08-08 16:07:01 +02:00
cpuidle-psci.c cpuidle: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
cpuidle-psci.h cpuidle: Factor-out power domain related code from PSCI domain driver 2022-03-10 09:29:44 -08:00
cpuidle-pseries.c powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-08-24 22:33:17 +10:00
cpuidle-qcom-spm.c cpuidle: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
cpuidle-riscv-sbi.c RISC-V: Align SBI probe implementation with spec 2023-04-29 13:04:50 -07:00
cpuidle-tegra.c cpuidle, arch: Mark all ct_cpuidle_enter() callers __cpuidle 2023-01-13 11:48:17 +01:00
cpuidle-ux500.c
cpuidle-zynq.c
cpuidle.c cpuidle: Use local_clock_noinstr() 2023-06-05 21:11:09 +02:00
cpuidle.h cpuidle: move to use bus_get_dev_root() 2023-03-22 20:25:23 +01:00
driver.c cpuidle: driver: Update microsecond values of state parameters as needed 2023-02-13 16:08:44 +01:00
dt_idle_genpd.c cpuidle: dt_idle_genpd: Add helper function to remove genpd topology 2023-08-08 16:06:20 +02:00
dt_idle_genpd.h cpuidle: dt_idle_genpd: Add helper function to remove genpd topology 2023-08-08 16:06:20 +02:00
dt_idle_states.c cpuidle: dt: Replace deprecated strncpy() with strscpy() 2023-09-29 14:48:31 -07:00
dt_idle_states.h
governor.c cpuidle: Remove redundant check in cpuidle_switch_governor() 2022-09-03 20:14:51 +02:00
Kconfig cpuidle-haltpoll: select haltpoll governor 2023-01-13 20:50:46 +01:00
Kconfig.arm cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT 2023-02-13 17:15:42 +01:00
Kconfig.mips
Kconfig.powerpc
Kconfig.riscv cpuidle: Add RISC-V SBI CPU idle driver 2022-03-10 09:29:51 -08:00
Makefile cpuidle: Add RISC-V SBI CPU idle driver 2022-03-10 09:29:51 -08:00
poll_state.c cpuidle: Use local_clock_noinstr() 2023-06-05 21:11:09 +02:00
sysfs.c cpuidle: move to use bus_get_dev_root() 2023-03-22 20:25:23 +01:00