[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5ef3d27e224bd_7c272b1cd50b45c474@john-XPS-13-9370.notmuch>
Date: Wed, 24 Jun 2020 15:23:58 -0700
From: John Fastabend <john.fastabend@...il.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>,
John Fastabend <john.fastabend@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [bpf PATCH] bpf: do not allow btf_ctx_access with __int128 types
Andrii Nakryiko wrote:
> On Tue, Jun 23, 2020 at 10:14 AM John Fastabend
> <john.fastabend@...il.com> wrote:
> >
> > To ensure btf_ctx_access() is safe the verifier checks that the BTF
> > arg type is an int, enum, or pointer. When the function does the
> > BTF arg lookup it uses the calculation 'arg = off / 8' using the
> > fact that registers are 8B. This requires that the first arg is
> > in the first reg, the second in the second, and so on. However,
> > for __int128 the arg will consume two registers by default LLVM
> > implementation. So this will cause the arg layout assumed by the
> > 'arg = off / 8' calculation to be incorrect.
> >
> > Because __int128 is uncommon this patch applies the easiest fix and
> > will force int types to be sizeof(u64) or smaller so that they will
> > fit in a single register.
> >
> > Fixes: 9e15db66136a1 ("bpf: Implement accurate raw_tp context access via BTF")
> > Signed-off-by: John Fastabend <john.fastabend@...il.com>
> > ---
>
> "small int" for u64 looks funny, but naming is hard :)
>
> Acked-by: Andrii Nakryiko <andriin@...com>
>
Fixed up the parens and sent a v2 keeping the ACK. I don't have any
better ideas for the name, let me know if you have a preference for
something else.
Powered by blists - more mailing lists