Kees Cook
a3bfc09506
tcp: Replace strncpy() with strscpy()
...
Replace the deprecated[1] uses of strncpy() in tcp_ca_get_name_by_key()
and tcp_get_default_congestion_control(). The callers use the results as
standard C strings (via nla_put_string() and proc handlers respectively),
so trailing padding is not needed.
Since passing the destination buffer arguments decays it to a pointer,
the size can't be trivially determined by the compiler. ca->name is
the same length in both cases, so strscpy() won't fail (when ca->name
is NUL-terminated). Include the length explicitly instead of using the
2-argument strscpy().
Link: https://github.com/KSPP/linux/issues/90 [1]
Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20240714041111.it.918-kees@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-16 07:52:15 -07:00
..
2024-05-29 00:37:51 +02:00
2024-05-27 16:46:59 -07:00
2024-02-09 14:12:02 -08:00
2024-05-01 18:37:07 -07:00
2024-05-30 15:34:13 -07:00
2024-06-20 13:49:59 -07:00
2024-02-12 17:33:05 -08:00
2024-06-05 12:34:54 +01:00
2024-07-15 13:19:17 -07:00
2024-07-15 13:19:17 -07:00
2024-06-05 12:34:54 +01:00
2022-02-17 11:44:20 -08:00
2021-09-28 17:32:56 -07:00
2024-01-03 16:42:48 -08:00
2024-07-15 13:19:17 -07:00
2024-02-26 11:46:13 +00:00
2024-04-01 10:49:28 +01:00
2024-06-17 17:49:50 -07:00
2023-05-26 10:30:14 +01:00
2023-05-26 10:30:14 +01:00
2024-04-01 10:49:28 +01:00
2024-03-05 13:30:11 +01:00
2024-05-08 10:39:26 +01:00
2024-04-08 13:20:51 +01:00
2024-06-27 12:14:11 -07:00
2024-07-04 15:25:09 +02:00
2024-05-23 14:14:23 -07:00
2024-05-09 20:25:55 -07:00
2024-06-10 11:54:18 +01:00
2024-01-31 16:39:42 -08:00
2023-10-13 09:58:45 -07:00
2024-05-23 14:14:23 -07:00
2024-05-07 16:19:14 -07:00
2024-04-30 18:32:38 -07:00
2022-01-29 17:53:07 +00:00
2024-05-23 14:14:36 -07:00
2024-03-06 12:37:06 +00:00
2024-04-01 10:49:28 +01:00
2024-06-11 19:24:37 -07:00
2024-04-01 10:49:28 +01:00
2022-09-29 07:18:00 +02:00
2023-05-22 11:17:55 +01:00
2024-04-01 10:49:28 +01:00
2022-06-24 11:34:38 +01:00
2024-04-01 10:49:28 +01:00
2023-10-27 10:35:44 +01:00
2024-01-04 10:23:10 -08:00
2024-06-05 10:06:00 +01:00
2023-10-06 08:31:53 +02:00
2019-05-21 10:50:45 +02:00
2024-03-22 18:03:29 -07:00
2024-06-19 12:44:22 +01:00
2024-04-30 18:46:52 -07:00
2021-05-17 15:29:35 -07:00
2024-01-23 15:13:54 +01:00
2024-06-19 12:44:22 +01:00
2024-06-12 16:42:11 -07:00
2024-06-19 12:44:22 +01:00
2024-06-12 16:42:11 -07:00
2024-06-20 13:49:59 -07:00
2024-05-02 16:26:56 -07:00
2022-04-06 12:05:41 -07:00
2023-10-18 18:09:31 -07:00
2022-10-16 15:27:07 -07:00
2024-07-16 07:52:15 -07:00
2024-03-28 18:31:40 -07:00
2024-05-21 13:34:50 +02:00
2018-10-10 22:26:00 -07:00
2024-01-23 15:13:54 +01:00
2024-06-06 11:52:52 +02:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2024-07-13 15:19:49 -07:00
2024-06-24 16:41:22 -07:00
2023-10-23 09:35:01 +01:00
2024-07-01 09:40:36 +01:00
2024-07-16 11:56:14 +02:00
2022-04-06 12:05:41 -07:00
2024-05-13 14:44:06 -07:00
2024-06-12 06:39:04 +01:00
2022-12-20 03:13:45 +01:00
2022-04-28 13:02:01 -07:00
2023-10-17 17:25:42 -07:00
2022-04-06 12:05:41 -07:00
2024-06-24 16:41:22 -07:00
2024-07-11 12:58:13 -07:00
2023-01-19 09:26:16 -08:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2024-06-12 06:39:04 +01:00
2024-02-09 14:12:02 -08:00
2023-03-03 17:25:15 +01:00
2024-01-23 15:13:54 +01:00
2023-06-24 15:50:13 -07:00
2024-06-28 18:12:59 -07:00
2024-04-01 10:49:28 +01:00
2023-10-03 11:39:34 +02:00
2020-07-10 13:54:00 -07:00
2024-07-11 12:58:13 -07:00
2023-09-14 16:16:36 +02:00
2024-05-09 10:01:01 -07:00
2020-05-11 15:12:27 +02:00
2024-05-03 13:29:42 +01:00
2022-06-08 10:10:13 -07:00
2020-05-06 09:40:08 +02:00
2024-02-09 14:12:02 -08:00