Martin KaFai Lau
78958fca7e
bpf: btf: Introduce BTF ID
...
This patch gives an ID to each loaded BTF. The ID is allocated by
the idr like the existing prog-id and map-id.
The bpf_put(map->btf) is moved to __bpf_map_put() so that the
userspace can stop seeing the BTF ID ASAP when the last BTF
refcnt is gone.
It also makes BTF accessible from userspace through the
1. new BPF_BTF_GET_FD_BY_ID command. It is limited to CAP_SYS_ADMIN
which is inline with the BPF_BTF_LOAD cmd and the existing
BPF_[MAP|PROG]_GET_FD_BY_ID cmd.
2. new btf_id (and btf_key_id + btf_value_id) in "struct bpf_map_info"
Once the BTF ID handler is accessible from userspace, freeing a BTF
object has to go through a rcu period. The BPF_BTF_GET_FD_BY_ID cmd
can then be done under a rcu_read_lock() instead of taking
spin_lock.
[Note: A similar rcu usage can be done to the existing
bpf_prog_get_fd_by_id() in a follow up patch]
When processing the BPF_BTF_GET_FD_BY_ID cmd,
refcount_inc_not_zero() is needed because the BTF object
could be already in the rcu dead row . btf_get() is
removed since its usage is currently limited to btf.c
alone. refcount_inc() is used directly instead.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Alexei Starovoitov <ast@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-05-09 17:25:13 +02:00
..
2018-02-14 09:43:22 -08:00
2018-03-31 01:33:09 +08:00
2018-01-16 15:11:32 +01:00
2018-04-02 11:17:51 +02:00
2018-04-13 15:51:06 -07:00
2018-01-04 13:35:07 -05:00
2018-03-21 13:58:08 +09:00
2018-03-23 15:52:48 +01:00
2018-03-27 15:34:20 +02:00
2018-02-01 09:51:57 -08:00
2018-01-01 22:54:42 -08:00
2018-04-04 15:19:26 -07:00
2018-01-14 23:06:30 -05:00
2018-04-13 16:20:36 -07:00
2018-03-15 15:58:03 -06:00
2018-05-04 09:58:56 -04:00
2018-03-05 13:04:32 +01:00
2018-04-24 17:41:18 +02:00
2018-01-09 16:51:44 +01:00
2018-05-07 00:02:11 +02:00
2018-04-24 10:29:16 +02:00
2018-02-20 11:34:54 +00:00
2018-03-08 13:56:24 +05:30
2018-02-03 12:10:09 -08:00
2018-04-21 16:32:48 -04:00
2018-02-22 13:57:30 -08:00
2018-05-07 23:46:10 -04:00
2018-04-07 12:08:19 -07:00
2018-02-16 17:05:52 +00:00
2018-04-11 10:28:37 -07:00
2018-04-18 21:00:56 -04:00
2017-12-19 11:32:35 +01:00
2018-02-14 16:02:41 +00:00
2018-04-12 12:55:50 -07:00
2018-04-05 10:42:07 -07:00
2018-02-14 15:15:41 +01:00
2018-02-26 08:43:20 +01:00
2018-01-10 12:53:34 +01:00
2018-01-13 10:44:56 +00:00
2018-02-06 22:54:15 +00:00
2018-01-10 23:25:08 -05:00
2018-02-14 11:55:33 -05:00
2018-03-21 11:17:41 -04:00
2018-04-20 17:18:35 -07:00
2018-04-20 17:18:35 -07:00
2018-01-29 10:34:53 -05:00
2018-04-11 10:28:37 -07:00
2018-03-01 08:41:25 -07:00
2017-12-17 12:36:01 -05:00
2018-04-02 20:52:27 -07:00
2017-12-17 12:58:53 +01:00
2018-03-21 19:23:33 -06:00
2018-03-16 10:35:12 -06:00
2018-03-27 21:25:36 -06:00
2018-04-25 07:58:18 -06:00
2018-04-25 21:13:40 -07:00
2018-03-16 10:56:13 +01:00
2018-04-30 10:55:56 +02:00
2018-05-03 15:55:24 -07:00
2018-05-04 11:58:36 +02:00
2018-03-31 02:16:26 +02:00
2018-05-04 23:41:03 +02:00
2017-12-15 15:41:13 -05:00
2018-03-13 11:40:24 -06:00
2018-03-13 11:40:24 -06:00
2018-05-09 17:25:13 +02:00
2018-02-04 11:16:35 -08:00
2018-02-06 18:32:46 -08:00
2018-01-06 09:18:00 -07:00
2018-04-03 18:00:13 -07:00
2018-03-12 15:10:26 -07:00
2018-03-16 15:45:51 -07:00
2018-01-04 15:13:29 -08:00
2018-04-15 16:12:35 -07:00
2018-04-20 17:18:35 -07:00
2018-04-11 10:28:35 -07:00
2018-02-21 15:35:43 -08:00
2018-01-08 17:30:45 +01:00
2018-02-27 10:17:33 +01:00
2018-04-11 10:28:38 -07:00
2018-04-19 12:29:41 -03:00
2018-01-03 14:03:48 +01:00
2018-01-14 09:51:25 -08:00
2018-04-10 08:40:45 +02:00
2018-03-16 10:55:47 +01:00
2018-04-06 09:29:34 +02:00
2018-02-16 10:40:24 +01:00
2018-02-06 18:32:47 -08:00
2018-01-13 10:42:48 -08:00
2018-02-06 18:32:47 -08:00
2018-03-26 15:09:38 +02:00
2018-01-08 10:08:33 +00:00
2017-12-14 16:00:49 -08:00
2018-03-23 23:48:43 +08:00
2018-04-03 05:41:19 -07:00
2018-04-04 00:40:19 -04:00
2018-01-16 03:29:36 +01:00
2018-04-06 11:50:19 -07:00
2018-04-19 09:48:32 +02:00
2018-04-03 15:04:23 -04:00
2018-03-20 10:01:59 +01:00
2018-04-05 10:23:24 -07:00
2018-02-12 09:18:56 +05:30
2018-03-16 19:58:27 +01:00
2018-04-05 14:21:13 -07:00
2018-03-14 12:32:06 +01:00
2018-03-12 10:05:01 +01:00
2018-01-18 12:54:41 -07:00
2018-01-12 17:33:38 -08:00
2018-01-01 12:40:27 -07:00
2018-02-08 15:13:30 -05:00
2018-04-27 11:53:02 -04:00
2018-01-06 13:47:20 -05:00
2018-03-08 10:34:44 +09:00
2018-03-17 13:57:39 +09:00
2018-04-05 21:36:26 -07:00
2018-03-26 15:56:44 +02:00
2018-01-30 21:54:32 +01:00
2018-05-03 16:49:19 -07:00
2018-03-22 18:33:26 +01:00
2018-04-12 12:28:32 -07:00
2018-04-06 14:05:14 +01:00
2018-04-06 14:05:14 +01:00
2018-01-11 23:30:13 -05:00
2018-01-11 23:30:13 -05:00
2018-01-11 23:30:08 -05:00
2018-03-21 10:22:28 +01:00
2018-04-25 21:23:38 -07:00
2018-01-29 09:08:34 -08:00
2018-04-02 20:15:02 +02:00
2018-02-12 10:41:11 +01:00
2018-02-26 09:48:42 -07:00
2018-02-06 18:32:46 -08:00
2018-03-14 10:13:22 -07:00
2018-04-09 09:26:12 +02:00
2018-03-18 07:38:48 -07:00
2018-01-01 21:39:12 -08:00
2018-04-11 10:28:31 -07:00
2018-01-01 21:39:12 -08:00
2018-04-26 14:53:32 +02:00
2018-01-31 17:18:40 -08:00
2018-03-13 15:24:02 +01:00
2018-02-28 16:37:57 +00:00
2018-04-09 11:42:31 -07:00
2018-03-08 12:30:37 +01:00
2018-03-24 13:26:13 +01:00
2018-03-06 10:57:59 +01:00
2018-04-05 14:27:02 -07:00
2018-04-11 10:28:39 -07:00
2018-02-22 21:13:03 +01:00
2018-04-30 12:42:40 -04:00
2018-01-09 07:40:48 +02:00
2018-04-25 08:26:19 -07:00
2018-01-09 10:56:10 -05:00
2018-04-17 10:50:28 -04:00
2018-04-17 13:59:28 -04:00
2018-03-26 08:53:43 -06:00
2018-01-24 19:13:45 -05:00
2018-01-17 11:30:16 +00:00
2018-02-20 11:17:58 +01:00
2017-12-11 17:20:39 -05:00
2018-02-13 17:40:54 +01:00
2017-12-17 12:52:34 +01:00
2018-02-16 08:59:16 +01:00
2018-02-13 19:31:20 +01:00
2018-02-06 18:32:47 -08:00
2018-03-24 11:25:36 -05:00
2018-02-27 07:42:51 -06:00
2018-02-27 07:42:51 -06:00
2018-02-27 07:42:51 -06:00
2017-12-21 13:07:20 -05:00
2018-01-08 19:43:15 +01:00
2018-03-14 21:46:29 +01:00
2017-12-28 12:26:35 +01:00
2017-12-29 21:13:04 +01:00
2018-01-29 09:08:34 -08:00
2018-02-01 08:15:25 -05:00
2018-01-10 00:27:29 -05:00
2018-04-06 09:28:50 +02:00
2018-03-20 08:57:17 +01:00
2018-02-06 18:32:45 -08:00
2018-04-05 21:36:24 -07:00
2018-03-31 12:22:38 +09:00
2018-02-13 09:15:58 +01:00
2018-04-11 10:28:35 -07:00
2018-04-13 17:10:28 -07:00
2018-04-11 10:28:38 -07:00
2018-01-12 17:33:38 -08:00
2018-02-24 01:43:47 +01:00
2018-03-06 18:40:44 +01:00
2017-12-11 13:17:22 -05:00
2018-03-11 20:01:55 +01:00
2018-03-13 13:29:10 -07:00
2018-03-05 20:58:17 -06:00
2018-01-11 14:39:07 -06:00
2018-04-07 07:53:23 -07:00
2018-02-02 16:50:28 -08:00
2018-03-29 17:29:09 -06:00
2018-03-26 15:56:42 +02:00
2018-04-05 21:36:27 -07:00
2018-04-17 13:42:48 +02:00
2018-01-30 10:44:56 -08:00
2018-04-12 09:41:19 -07:00
2018-03-21 17:18:34 -05:00
2018-04-07 16:53:59 -07:00
2018-04-19 15:59:10 -04:00
2018-04-19 15:59:11 -04:00
2018-01-03 11:00:22 -05:00
2018-04-07 12:08:19 -07:00
2018-04-11 10:28:31 -07:00
2018-04-11 10:28:32 -07:00
2018-04-05 21:36:25 -07:00
2018-01-08 11:46:23 -08:00
2018-04-21 16:32:48 -04:00
2018-04-11 10:28:32 -07:00
2018-02-13 16:25:06 +01:00
2018-04-05 21:36:27 -07:00
2018-04-11 10:28:39 -07:00
2018-03-18 07:38:47 -07:00
2018-04-05 21:36:27 -07:00
2018-01-31 17:18:38 -08:00
2018-04-11 10:28:32 -07:00
2018-04-13 15:37:59 +02:00
2018-02-06 18:32:47 -08:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-26 13:14:43 -04:00
2018-03-24 11:25:35 -05:00
2018-03-10 10:19:28 +01:00
2018-03-15 07:17:21 -07:00
2018-04-24 10:15:07 -04:00
2018-04-16 18:26:37 -04:00
2018-05-01 09:42:47 -04:00
2018-05-07 23:35:08 -04:00
2018-01-08 18:01:12 +01:00
2018-01-08 18:10:53 +01:00
2018-01-08 18:10:53 +01:00
2018-01-08 18:11:02 +01:00
2018-01-15 15:15:23 -05:00
2018-01-14 23:06:29 -05:00
2018-04-10 16:06:22 -04:00
2018-04-10 16:06:22 -04:00
2018-04-05 21:36:25 -07:00
2018-02-17 08:40:59 +01:00
2018-01-28 22:17:24 -05:00
2018-01-16 16:47:29 +01:00
2018-01-17 17:55:14 +01:00
2018-03-14 19:28:13 +01:00
2018-01-08 08:22:45 -06:00
2018-01-08 08:24:34 -06:00
2018-02-01 10:57:45 -08:00
2018-01-08 08:22:45 -06:00
2018-01-17 15:25:50 +01:00
2018-03-30 10:40:18 -04:00
2018-03-05 18:03:20 -06:00
2018-01-08 08:22:45 -06:00
2018-01-08 08:22:45 -06:00
2018-03-05 13:29:46 -06:00
2018-01-12 16:41:15 +01:00
2017-12-14 16:00:49 -08:00
2018-04-05 21:36:25 -07:00
2018-04-05 21:36:25 -07:00
2018-04-11 10:28:32 -07:00
2018-04-11 10:28:39 -07:00
2018-01-31 17:18:37 -08:00
2018-01-28 15:49:06 -06:00
2018-04-06 18:31:06 -07:00
2017-12-18 23:02:57 -06:00
2018-01-17 18:05:51 -06:00
2018-01-28 15:48:29 -06:00
2018-01-28 15:48:29 -06:00
2018-04-03 12:38:05 +01:00
2018-04-03 12:23:38 +01:00
2018-04-06 18:31:06 -07:00
2017-12-15 05:28:06 -08:00
2018-03-19 10:09:44 -07:00
2018-03-29 16:07:22 +02:00
2018-01-19 16:50:53 -08:00
2018-01-03 10:38:54 -05:00
2018-04-28 16:48:04 -04:00
2018-03-30 10:11:06 -04:00
2018-02-06 18:32:47 -08:00
2018-01-09 13:09:17 +01:00
2017-12-16 02:05:48 +01:00
2018-02-11 14:37:22 -08:00
2018-01-02 19:27:28 -08:00
2018-01-04 14:57:10 +01:00
2018-02-21 23:27:13 +01:00
2018-03-15 13:25:36 +01:00
2017-12-31 16:12:23 +01:00
2018-02-12 10:41:11 +01:00
2018-02-06 22:54:11 +00:00
2018-03-07 12:47:06 -08:00
2017-12-23 21:12:59 +01:00
2018-02-14 14:33:36 -05:00
2018-02-19 18:46:11 -05:00
2017-12-20 15:38:34 -06:00
2018-03-26 13:11:35 +02:00
2018-04-02 20:15:46 +02:00
2018-04-11 10:28:39 -07:00
2018-02-12 11:43:25 -05:00
2018-02-28 17:59:21 -05:00
2017-12-14 16:00:48 -08:00
2017-12-17 13:57:15 +01:00
2018-02-20 16:12:26 -08:00
2017-12-11 14:37:11 -07:00
2018-02-26 11:05:44 +00:00
2018-02-12 16:57:22 -08:00
2018-03-27 10:39:47 +02:00
2018-04-24 13:21:45 -04:00
2018-03-10 16:06:04 -05:00
2018-03-17 14:20:55 +01:00
2018-03-29 13:47:53 -04:00
2018-03-01 08:33:05 -07:00
2017-12-12 11:24:01 +01:00
2018-02-28 12:23:35 -07:00
2018-04-05 14:27:02 -07:00
2018-04-05 10:56:16 +02:00
2018-02-11 14:34:03 -08:00
2018-02-28 16:37:57 +00:00
2017-12-15 13:52:21 -05:00
2018-04-07 16:53:59 -07:00
2018-03-22 21:30:56 -05:00
2018-02-13 15:00:06 +01:00
2018-04-11 10:28:36 -07:00
2018-02-01 09:46:00 -08:00
2018-04-23 10:06:59 +02:00
2018-02-12 19:55:21 +01:00
2018-03-20 10:01:58 +01:00
2018-02-28 11:07:11 -05:00
2018-01-09 10:37:00 -05:00
2018-04-13 17:10:28 -07:00
2018-03-28 13:29:57 -05:00
2018-01-31 17:18:39 -08:00
2018-04-16 02:06:47 -04:00
2018-01-12 14:34:49 -06:00
2017-12-19 09:26:00 +01:00
2018-03-08 13:49:26 +00:00
2018-01-29 12:02:54 -05:00
2018-05-08 00:02:36 -04:00
2018-04-05 21:36:24 -07:00
2018-04-05 21:36:27 -07:00
2017-12-19 11:01:02 +01:00
2018-04-05 21:36:24 -07:00
2018-04-24 11:15:32 -04:00
2018-05-03 15:55:23 -07:00
2018-01-11 17:05:23 +01:00
2017-12-12 11:24:01 +01:00
2017-12-16 22:11:55 -05:00
2018-01-18 11:56:49 +01:00
2018-01-15 12:07:46 -08:00
2018-03-28 18:47:17 +03:00
2018-01-31 09:25:20 -08:00
2018-04-28 15:01:14 -07:00
2018-02-07 12:18:23 +01:00
2018-04-05 21:36:25 -07:00
2018-01-21 17:44:47 -08:00
2018-03-20 10:01:59 +01:00
2018-02-06 09:59:40 -08:00
2018-02-05 21:34:50 +01:00
2018-04-09 16:47:27 +02:00
2018-02-06 18:32:47 -08:00
2018-01-09 16:27:43 +01:00
2018-05-01 18:56:29 -04:00
2018-01-11 18:05:06 -08:00
2018-04-16 18:53:13 -04:00
2018-04-02 21:49:01 +08:00
2018-04-20 17:18:35 -07:00
2018-03-09 12:54:11 +03:00
2018-04-18 10:07:13 -07:00
2018-04-09 11:54:56 +02:00
2018-03-19 15:23:03 +01:00
2018-04-26 14:53:32 +02:00
2018-04-17 17:18:05 +02:00
2018-04-26 14:53:32 +02:00
2018-04-17 17:18:04 +02:00
2018-04-29 08:45:53 -07:00
2017-12-11 09:18:29 -08:00
2018-01-08 12:58:34 +02:00
2018-03-23 10:18:05 +02:00
2018-04-10 11:27:30 -07:00
2018-03-28 22:55:19 +02:00
2018-04-23 11:05:52 +02:00
2018-02-20 16:10:25 -08:00
2018-05-07 23:25:24 -04:00
2018-01-15 12:07:48 -08:00
2018-04-26 15:08:04 -04:00
2017-12-15 20:45:43 +01:00
2018-04-11 10:28:35 -07:00
2018-02-06 18:32:44 -08:00
2018-04-23 13:41:55 +02:00
2018-01-24 09:00:05 -08:00
2017-12-20 09:53:54 -07:00
2018-03-13 22:58:09 +01:00
2018-04-25 20:33:19 +03:00
2018-04-11 10:28:30 -07:00
2018-03-20 08:23:24 +01:00
2018-02-16 15:19:09 +01:00
2018-04-03 18:00:13 -07:00
2018-04-11 10:28:39 -07:00
2018-01-31 17:18:39 -08:00
2018-04-05 21:36:26 -07:00