[DTrace-devel] [PATCH v2 17/20] Allocate extra space in the strtab to help the BPF verifier
Eugene Loh
eugene.loh at oracle.com
Fri Jun 4 13:12:26 PDT 2021
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Ah, this patch updates the comment block in dt_bpf.c as I requested in a
different patch review, thanks. But just need s/vaule/value/ in that
comment. Anyhow, nice fix and great to see those tests pass.
On 6/3/21 11:19 AM, Kris Van Hees wrote:
> Although the internal consistency of the strtab data (generated by
> the compiler) guarantees that access to string constants will never
> read outside the strtab, the BPF verifier cannot verify that through
> static code analysis. By padding the strtab with enough space to
> store the largest supported string we guarantee that any access up
> to the maximum string size can succeed.
>
> diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c
> @@ -253,11 +255,15 @@ dt_bpf_gmap_create(dtrace_hdl_t *dtp)
> /*
> - * We may need to create a final copy of the string table because it is
> - * possible entries were added after the last clause was compiled.
> + * We need to create the global (consolidated) string table. We store
> + * the actual length (for in-code BPF validation purposes) but augment
> + * it by the maximum string size to determine the size of the BPF map
> + * vaule that is used to store the strtab.
> */
There's the vaule.
More information about the DTrace-devel
mailing list