Hao Luo
4976b718c3
bpf: Introduce pseudo_btf_id
...
Pseudo_btf_id is a type of ld_imm insn that associates a btf_id to a
ksym so that further dereferences on the ksym can use the BTF info
to validate accesses. Internally, when seeing a pseudo_btf_id ld insn,
the verifier reads the btf_id stored in the insn[0]'s imm field and
marks the dst_reg as PTR_TO_BTF_ID. The btf_id points to a VAR_KIND,
which is encoded in btf_vminux by pahole. If the VAR is not of a struct
type, the dst reg will be marked as PTR_TO_MEM instead of PTR_TO_BTF_ID
and the mem_size is resolved to the size of the VAR's type.
>From the VAR btf_id, the verifier can also read the address of the
ksym's corresponding kernel var from kallsyms and use that to fill
dst_reg.
Therefore, the proper functionality of pseudo_btf_id depends on (1)
kallsyms and (2) the encoding of kernel global VARs in pahole, which
should be available since pahole v1.18.
Signed-off-by: Hao Luo <haoluo@google.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Acked-by: Andrii Nakryiko <andriin@fb.com >
Link: https://lore.kernel.org/bpf/20200929235049.2533242-2-haoluo@google.com
2020-10-02 14:59:25 -07:00
..
2020-09-21 10:13:19 +02:00
2020-08-24 10:33:08 +02:00
2020-08-03 11:05:26 +02:00
2020-08-12 10:57:59 -07:00
2020-09-20 19:01:34 -07:00
2020-08-05 11:43:47 -07:00
2020-09-18 17:49:20 -07:00
2020-08-04 01:22:02 +02:00
2020-08-12 10:57:59 -07:00
2020-08-07 12:58:11 -07:00
2020-08-27 06:55:50 -07:00
2020-08-15 08:09:38 -07:00
2020-09-30 21:26:28 -07:00
2020-08-05 20:13:21 -07:00
2020-08-07 08:54:16 +02:00
2020-09-09 11:21:19 -07:00
2020-08-27 06:55:50 -07:00
2020-09-30 14:18:19 -07:00
2020-09-22 16:45:34 -07:00
2020-08-17 09:39:18 -07:00
2020-08-16 22:00:22 +01:00
2020-08-15 08:26:55 -07:00
2020-08-05 20:13:21 -07:00
2020-08-04 18:11:58 -07:00
2020-08-03 19:30:59 -07:00
2020-08-12 10:57:59 -07:00
2020-08-10 12:16:51 -07:00
2020-08-05 11:12:34 -07:00
2020-08-25 15:00:04 -07:00
2020-08-25 15:00:04 -07:00
2020-08-25 15:00:04 -07:00
2020-10-02 14:59:25 -07:00
2020-08-24 14:35:00 -07:00
2020-09-29 13:09:24 -07:00
2020-09-21 17:16:17 -07:00
2020-09-21 15:00:40 -07:00
2020-10-02 14:59:25 -07:00
2020-08-12 10:57:59 -07:00
2020-09-02 20:59:40 -06:00
2020-08-03 15:07:18 -07:00
2020-08-12 10:57:56 -07:00
2020-08-23 17:36:59 -05:00
2020-08-27 09:53:06 +02:00
2020-08-29 09:29:32 +02:00
2020-08-12 10:57:59 -07:00
2020-08-04 13:49:43 -07:00
2020-08-03 14:25:40 -07:00
2020-09-30 11:50:35 -07:00
2020-08-27 12:51:25 +02:00
2020-09-17 18:12:18 +01:00
2020-09-16 19:36:26 +02:00
2020-08-12 10:58:01 -07:00
2020-09-21 06:53:09 -07:00
2020-08-12 10:57:59 -07:00
2020-08-03 11:57:03 -07:00
2020-09-10 19:19:42 +02:00
2020-08-14 15:22:43 -07:00
2020-08-14 16:27:00 +02:00
2020-08-14 16:27:00 +02:00
2020-08-07 12:41:36 -07:00
2020-09-04 17:21:56 +02:00
2020-08-06 16:13:13 +02:00
2020-09-10 18:19:16 +02:00
2020-08-07 11:33:28 -07:00
2020-09-04 15:50:14 +02:00
2020-09-15 13:26:28 -07:00
2020-08-12 10:57:59 -07:00
2020-08-04 07:37:23 +02:00
2020-09-23 13:11:11 -07:00
2020-08-12 10:57:57 -07:00
2020-09-16 19:12:27 -04:00
2020-08-28 10:57:14 -07:00
2020-09-19 13:13:39 -07:00
2020-08-12 10:57:59 -07:00
2020-09-01 12:06:41 +02:00
2020-08-12 10:57:57 -07:00
2020-08-06 16:13:13 +02:00
2020-08-14 19:56:56 -07:00
2020-08-12 10:58:02 -07:00
2020-08-06 17:54:04 +02:00
2020-09-09 10:22:40 +02:00
2020-08-13 18:41:00 -07:00
2020-09-18 12:27:27 +02:00
2020-09-23 13:24:34 -07:00
2020-08-19 14:02:49 -07:00
2020-09-03 15:17:28 -07:00
2020-08-04 21:02:38 -04:00
2020-08-14 19:56:57 -07:00
2020-08-14 19:56:57 -07:00
2020-08-31 13:08:10 -07:00
2020-08-26 12:41:56 +02:00
2020-08-21 11:03:38 -07:00
2020-08-23 17:36:59 -05:00
2020-08-07 11:33:28 -07:00
2020-08-28 11:21:20 -07:00
2020-09-18 14:27:24 -04:00
2020-09-04 09:25:20 -07:00
2020-08-06 16:13:13 +02:00
2020-08-21 14:04:14 +01:00
2020-08-12 10:57:59 -07:00
2020-09-02 11:31:23 -06:00
2020-08-02 20:39:44 -07:00
2020-08-26 12:41:53 +02:00
2020-09-05 12:14:30 -07:00
2020-08-11 14:30:36 -07:00
2020-08-11 14:30:36 -07:00
2020-08-07 21:27:37 -07:00
2020-09-23 18:02:49 -07:00
2020-08-14 19:56:57 -07:00
2020-08-12 10:57:56 -07:00
2020-09-04 09:59:59 +02:00
2020-09-11 17:41:55 -07:00
2020-08-12 10:58:02 -07:00
2020-08-14 19:56:56 -07:00
2020-08-14 19:56:56 -07:00
2020-09-17 10:26:41 -07:00
2020-08-07 11:33:26 -07:00
2020-08-26 12:41:53 +02:00
2020-08-07 11:33:21 -07:00
2020-08-12 10:57:56 -07:00
2020-08-05 10:31:28 +02:00
2020-08-06 16:13:13 +02:00
2020-08-24 16:16:06 -07:00
2020-09-10 13:30:22 -07:00
2020-09-29 14:02:53 -07:00
2020-08-13 04:16:15 +02:00
2020-08-15 08:26:55 -07:00
2020-09-24 19:49:36 -07:00
2020-09-05 13:09:03 -07:00
2020-08-12 10:57:56 -07:00
2020-08-07 11:33:29 -07:00
2020-08-14 19:56:56 -07:00
2020-08-12 12:09:36 -07:00
2020-08-07 18:48:15 -07:00
2020-08-31 12:52:33 -07:00
2020-08-07 11:33:26 -07:00
2020-09-16 16:26:56 +02:00
2020-08-05 20:13:21 -07:00
2020-08-17 21:50:54 +03:00
2020-09-23 18:02:49 -07:00
2020-08-31 12:52:33 -07:00
2020-08-04 12:44:53 +02:00
2020-08-04 12:39:28 +02:00
2020-08-12 10:57:59 -07:00
2020-08-06 16:50:59 +02:00
2020-09-10 19:27:59 +02:00
2020-08-03 23:24:26 -07:00
2020-09-14 09:45:34 -07:00
2020-09-27 13:29:49 -07:00
2020-08-03 23:24:26 -07:00
2020-08-03 14:39:35 -07:00
2020-09-23 19:32:09 -07:00
2020-08-04 20:16:37 -07:00
2020-08-26 12:41:51 +02:00
2020-08-04 21:00:11 -07:00
2020-08-06 16:13:13 +02:00
2020-09-16 13:22:44 +02:00
2020-08-07 11:33:24 -07:00
2020-08-23 17:36:59 -05:00
2020-09-30 11:50:35 -07:00
2020-08-21 15:16:11 -07:00
2020-08-07 11:33:25 -07:00
2020-08-07 11:33:25 -07:00
2020-08-07 11:33:25 -07:00
2020-09-30 11:50:35 -07:00
2020-08-10 12:06:44 -07:00
2020-09-19 13:13:39 -07:00
2020-09-28 18:43:57 -07:00
2020-08-12 10:57:56 -07:00
2020-08-14 19:56:56 -07:00
2020-08-14 19:56:56 -07:00
2020-09-10 13:15:40 -07:00
2020-08-06 16:13:13 +02:00
2020-08-07 17:05:01 -04:00
2020-08-03 13:34:37 -04:00
2020-08-12 10:57:59 -07:00
2020-08-05 19:00:23 -04:00
2020-08-01 11:28:17 +02:00
2020-08-06 16:13:13 +02:00
2020-08-05 11:08:41 -04:00
2020-08-05 19:56:03 -04:00
2020-08-05 09:30:19 -04:00
2020-09-04 09:31:54 -07:00
2020-08-07 11:33:24 -07:00
2020-09-17 10:26:41 -07:00
2020-08-05 18:43:02 +02:00
2020-08-12 10:57:59 -07:00
2020-08-06 16:13:13 +02:00
2020-08-09 13:58:04 -07:00
2020-08-12 10:57:59 -07:00
2020-08-12 10:57:59 -07:00
2020-08-12 10:57:59 -07:00