Yonghong Song
beb3d47d1d
bpf: Fix a BTF_ID_LIST bug with CONFIG_DEBUG_INFO_BTF not set
...
With CONFIG_DEBUG_INFO_BTF not set, we hit the following compilation error,
/.../kernel/bpf/verifier.c:8196:23: error: array index 6 is past the end of the array
(that has type 'u32[5]' (aka 'unsigned int[5]')) [-Werror,-Warray-bounds]
if (meta->func_id == special_kfunc_list[KF_bpf_cast_to_kern_ctx])
^ ~~~~~~~~~~~~~~~~~~~~~~~
/.../kernel/bpf/verifier.c:8174:1: note: array 'special_kfunc_list' declared here
BTF_ID_LIST(special_kfunc_list)
^
/.../include/linux/btf_ids.h:207:27: note: expanded from macro 'BTF_ID_LIST'
#define BTF_ID_LIST(name) static u32 __maybe_unused name[5];
^
/.../kernel/bpf/verifier.c:8443:19: error: array index 5 is past the end of the array
(that has type 'u32[5]' (aka 'unsigned int[5]')) [-Werror,-Warray-bounds]
btf_id == special_kfunc_list[KF_bpf_list_pop_back];
^ ~~~~~~~~~~~~~~~~~~~~
/.../kernel/bpf/verifier.c:8174:1: note: array 'special_kfunc_list' declared here
BTF_ID_LIST(special_kfunc_list)
^
/.../include/linux/btf_ids.h:207:27: note: expanded from macro 'BTF_ID_LIST'
#define BTF_ID_LIST(name) static u32 __maybe_unused name[5];
...
Fix the problem by increase the size of BTF_ID_LIST to 16 to avoid compilation error
and also prevent potentially unintended issue due to out-of-bound access.
Reported-by: kernel test robot <[email protected] >
Reported-by: Dan Carpenter <[email protected] >
Reported-by: Nathan Chancellor <[email protected] >
Signed-off-by: Yonghong Song <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected] >
2022-11-23 13:20:33 -08:00
..
2022-10-27 13:23:43 +02:00
2022-11-07 14:00:27 +01:00
2022-10-04 19:18:08 +02:00
2022-10-16 11:08:19 -07:00
2022-10-14 08:22:28 +01:00
2022-10-03 11:08:33 +01:00
2022-09-28 16:09:49 +01:00
2022-11-12 02:20:19 -08:00
2022-10-06 13:31:13 +02:00
2022-10-08 08:56:37 -07:00
2022-10-10 09:27:46 -07:00
2022-10-07 16:48:26 -07:00
2022-10-11 10:53:25 -07:00
2022-10-03 21:52:33 -07:00
2022-09-29 15:20:14 +01:00
2022-10-12 11:00:22 -07:00
2022-11-11 08:09:32 +00:00
2022-10-07 16:13:55 -07:00
2022-10-26 17:38:46 -07:00
2022-10-13 09:58:42 -07:00
2022-10-07 16:48:26 -07:00
2022-10-10 13:28:06 -07:00
2022-10-05 11:05:17 -06:00
2022-09-21 11:18:28 +09:00
2022-09-29 16:38:05 -07:00
2022-09-26 12:19:12 -07:00
2022-10-12 11:00:22 -07:00
2022-09-26 19:17:28 -06:00
2022-10-27 07:15:44 -06:00
2022-10-10 11:26:40 -06:00
2022-10-25 23:19:19 -07:00
2022-10-25 23:19:19 -07:00
2022-11-20 09:16:21 -08:00
2022-11-20 09:16:21 -08:00
2022-11-23 13:20:33 -08:00
2022-11-20 15:43:37 -08:00
2022-10-10 17:53:04 -07:00
2022-09-26 19:46:29 -07:00
2022-09-26 10:13:13 -07:00
2022-09-26 10:13:13 -07:00
2022-11-02 08:18:27 -07:00
2022-10-17 18:52:43 -07:00
2022-10-14 13:44:44 -07:00
2022-09-30 14:50:11 -07:00
2022-10-10 10:21:22 -07:00
2022-10-10 17:53:04 -07:00
2022-10-10 17:53:04 -07:00
2022-10-03 14:03:19 -07:00
2022-09-26 10:13:14 -07:00
2022-10-17 09:51:29 -04:00
2022-11-14 10:47:07 +00:00
2022-10-16 10:45:17 -07:00
2022-10-12 18:51:49 -07:00
2022-10-10 19:45:17 -07:00
2022-09-26 19:46:07 -07:00
2022-09-21 10:22:54 +02:00
2022-10-24 10:21:02 +02:00
2022-10-11 18:51:11 -07:00
2022-11-08 10:36:54 +01:00
2022-09-21 10:30:42 -06:00
2022-09-29 04:40:15 +09:00
2022-10-04 13:31:45 -07:00
2022-10-17 13:49:45 +02:00
2022-11-15 09:00:27 -08:00
2022-10-06 05:57:36 -07:00
2022-11-04 14:46:45 -07:00
2022-10-10 19:45:17 -07:00
2022-10-19 20:54:43 -07:00
2022-09-26 12:27:55 +02:00
2022-09-27 14:48:26 -04:00
2022-10-03 14:03:30 -07:00
2022-10-03 14:03:20 -07:00
2022-09-28 16:17:40 +01:00
2022-10-03 14:02:45 -07:00
2022-10-12 11:16:58 -07:00
2022-10-07 15:24:15 +02:00
2022-10-12 12:56:28 +02:00
2022-11-03 20:46:32 -07:00
2022-11-11 18:18:05 -08:00
2022-10-12 11:00:22 -07:00
2022-10-03 14:03:21 -07:00
2022-10-12 16:30:56 -06:00
2022-10-04 08:13:20 -06:00
2022-09-26 15:52:31 +02:00
2022-10-21 10:49:32 +02:00
2022-10-10 13:28:06 -07:00
2022-09-26 13:31:20 +02:00
2022-10-03 14:21:44 -07:00
2022-09-28 14:21:53 +01:00
2022-10-03 14:21:43 -07:00
2022-09-28 08:56:25 +02:00
2022-10-03 14:02:59 -07:00
2022-09-21 17:32:48 -07:00
2022-10-03 14:03:33 -07:00
2022-10-28 13:37:23 -07:00
2022-10-03 14:03:19 -07:00
2022-10-03 14:03:21 -07:00
2022-10-03 14:03:25 -07:00
2022-09-26 20:30:39 -07:00
2022-10-03 14:02:43 -07:00
2022-10-27 06:47:53 -04:00
2022-10-07 10:48:49 -07:00
2022-10-06 17:31:02 -07:00
2022-10-03 17:51:52 -07:00
2022-09-26 19:46:13 -07:00
2022-10-04 12:06:58 -06:00
2022-11-09 19:28:49 -08:00
2022-10-10 17:53:04 -07:00
2022-10-03 14:03:29 -07:00
2022-09-26 19:46:12 -07:00
2022-10-12 18:51:49 -07:00
2022-10-12 18:51:49 -07:00
2022-10-03 14:03:35 -07:00
2022-09-26 19:46:18 -07:00
2022-10-03 14:03:19 -07:00
2022-10-03 14:03:28 -07:00
2022-10-10 17:53:04 -07:00
2022-10-25 10:14:50 -07:00
2022-11-07 08:42:19 +00:00
2022-10-24 13:44:11 -07:00
2022-11-15 09:00:27 -08:00
2022-10-19 13:00:04 -07:00
2022-10-03 14:03:15 -07:00
2022-10-11 17:42:55 -06:00
2022-09-27 09:22:09 +02:00
2022-09-28 14:11:28 +01:00
2022-09-30 16:23:48 -05:00
2022-10-03 17:34:32 -07:00
2022-09-26 19:46:27 -07:00
2022-10-25 14:57:42 -07:00
2022-09-26 19:46:29 -07:00
2022-09-26 19:46:09 -07:00
2022-09-26 19:46:09 -07:00
2022-10-03 14:03:04 -07:00
2022-10-10 17:53:04 -07:00
2022-10-04 09:46:22 -07:00
2022-10-11 11:08:18 -07:00
2022-10-03 14:21:43 -07:00
2022-10-17 16:32:05 +02:00
2022-09-26 19:46:08 -07:00
2022-11-08 10:36:54 +01:00
2022-11-07 17:54:57 -08:00
2022-10-04 20:52:38 +02:00
2022-10-04 20:52:38 +02:00
2022-10-11 17:42:58 -06:00
2022-10-04 15:55:55 +02:00
2022-11-08 16:42:15 +00:00
2022-09-24 15:03:25 +02:00
2022-11-11 10:58:39 +00:00
2022-10-11 17:42:58 -06:00
2022-10-18 10:27:02 -07:00
2022-10-04 15:59:36 +02:00
2022-09-28 10:46:21 -06:00
2022-09-23 14:25:05 +02:00
2022-09-28 20:27:43 -04:00
2022-10-10 17:53:04 -07:00
2022-10-31 18:10:21 -07:00
2022-10-14 12:28:43 -07:00
2022-10-09 14:05:15 -07:00
2022-09-22 16:30:14 +02:00
2022-09-25 09:28:57 +02:00
2022-10-28 21:56:18 -07:00
2022-10-03 14:03:33 -07:00
2022-11-11 18:18:05 -08:00
2022-11-03 13:51:06 +01:00
2022-10-15 21:42:05 +02:00
2022-11-04 14:57:21 +01:00
2022-10-25 11:44:20 -07:00
2022-10-03 14:03:18 -07:00
2022-10-08 08:56:37 -07:00
2022-10-10 09:10:28 -07:00
2022-10-03 14:03:36 -07:00
2022-10-03 14:03:36 -07:00
2022-09-26 19:46:05 -07:00
2022-09-26 19:46:05 -07:00
2022-09-29 15:20:29 +02:00
2022-10-28 10:47:42 +01:00
2022-10-04 11:21:06 +02:00
2022-09-28 20:28:13 -04:00
2022-09-25 12:39:52 -04:00
2022-09-22 16:12:34 +02:00
2022-09-22 16:12:34 +02:00
2022-10-03 14:03:18 -07:00
2022-11-08 16:42:28 +00:00
2022-09-29 10:17:37 -04:00
2022-10-28 13:37:22 -07:00
2022-10-23 12:01:01 -07:00
2022-10-07 09:32:40 -04:00
2022-09-21 17:32:49 -07:00
2022-09-21 14:15:10 -06:00
2022-10-07 08:10:52 -06:00
2022-10-07 09:32:40 -04:00
2022-09-26 19:46:18 -07:00
2022-09-26 19:46:18 -07:00
2022-09-28 10:00:16 +02:00
2022-10-07 15:00:25 +02:00
2022-10-03 14:03:08 -07:00
2022-11-02 11:51:03 +00:00