Kees Cook
97f7d3f9c9
ACPICA: Replace strncpy() with strscpy_pad() in acpi_ut_safe_strncpy()
...
Replace the deprecated[1] strncpy() with strscpy_pad() in
acpi_ut_safe_strncpy().
The function is a "safe strncpy" wrapper that does
strncpy(dest, source, dest_size) followed by manual NUL-termination
at dest[dest_size - 1]. strscpy_pad() is a direct replacement: it
NUL-terminates, zero-pads the remainder, and the manual termination
is no longer needed.
All callers pass NUL-terminated source strings (C string literals,
__FILE__ via ACPI_MODULE_NAME, or user-provided filenames that have
already been validated). The destinations are fixed-size char arrays
in ACPICA internal structures (allocation->module, aml_op_name,
acpi_gbl_db_debug_filename), all consumed as C strings.
No behavioral change: strscpy_pad() produces identical output to
strncpy() + manual NUL-termination for NUL-terminated sources that
are shorter than dest_size. For sources longer than dest_size,
strncpy() wrote dest_size non-NUL bytes then the manual termination
overwrote the last byte with NUL; strscpy_pad() writes dest_size-1
bytes plus NUL: same result.
Link: https://github.com/KSPP/linux/issues/90 [1]
Signed-off-by: Kees Cook <kees@kernel.org >
Link: https://patch.msgid.link/20260323172451.work.079-kees@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com >
2026-03-23 18:32:34 +01:00
..
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-09-15 12:20:12 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-09-15 12:20:13 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2026-03-17 20:51:13 +01:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2023-07-10 18:48:15 +02:00
2024-08-02 16:51:07 +02:00
2020-06-05 13:34:23 +02:00
2020-10-08 18:03:55 +02:00
2019-10-28 22:12:46 +01:00
2025-05-12 15:38:43 +02:00
2023-07-10 18:48:15 +02:00
2020-10-08 18:03:55 +02:00
2024-03-26 13:06:47 +01:00
2021-01-18 16:01:10 +01:00
2019-08-21 00:00:37 +02:00
2019-02-18 11:21:10 +01:00
2018-03-18 19:08:05 +01:00
2020-03-30 14:52:32 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-09-15 12:20:13 +02:00
2025-04-24 22:01:18 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-03-27 13:17:18 +01:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-09-15 12:20:12 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2026-01-15 18:17:47 +01:00
2025-05-12 15:38:43 +02:00
2018-03-18 19:08:05 +01:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2026-01-15 18:17:48 +01:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-06-26 20:56:57 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2018-03-18 19:08:05 +01:00
2022-04-13 20:24:57 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2024-04-09 17:02:30 +02:00
2021-03-24 14:50:54 +01:00
2020-10-08 18:03:56 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2019-07-04 00:59:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:42 +02:00
2019-04-09 10:05:11 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2018-07-09 11:14:45 +02:00
2025-05-12 15:38:43 +02:00
2025-11-25 22:14:11 +01:00
2018-03-18 19:08:05 +01:00
2026-01-15 18:17:47 +01:00
2020-10-08 18:03:55 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-09-15 12:20:12 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-06 23:05:42 +02:00
2025-05-06 23:05:42 +02:00
2019-10-28 22:12:46 +01:00
2024-08-29 19:04:22 +02:00
2023-04-06 20:29:11 +02:00
2023-04-06 20:29:11 +02:00
2018-03-18 19:08:05 +01:00
2019-02-24 21:12:01 +01:00
2025-05-06 23:05:42 +02:00
2018-03-18 19:08:05 +01:00
2023-04-06 20:29:11 +02:00
2023-04-06 20:29:11 +02:00
2018-03-18 19:08:05 +01:00
2019-04-09 10:08:28 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-10-21 15:54:34 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:42 +02:00
2019-08-21 00:00:36 +02:00
2025-05-12 15:38:43 +02:00
2018-03-18 19:08:05 +01:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2018-03-18 19:08:05 +01:00
2019-04-09 10:08:28 +02:00
2018-05-10 17:18:45 +02:00
2026-03-23 18:32:34 +01:00
2026-01-15 18:17:47 +01:00
2026-01-15 18:17:48 +01:00
2019-08-21 00:00:36 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2023-04-06 20:29:11 +02:00
2025-05-06 23:05:42 +02:00
2018-03-18 19:08:05 +01:00
2022-10-28 17:28:23 +02:00
2021-01-22 15:51:53 +01:00
2018-08-14 23:49:13 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2025-05-12 15:38:43 +02:00
2019-01-15 18:04:02 +01:00
2025-05-12 15:38:43 +02:00
2018-03-18 19:08:05 +01:00