All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: John Fastabend <john.fastabend@gmail.com>,
	jolsa@kernel.org, andrii.nakryiko@gmail.com, ast@kernel.org
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [bpf PATCH] bpf: Do not allow btf_ctx_access with __int128 types
Date: Thu, 25 Jun 2020 17:01:40 +0200	[thread overview]
Message-ID: <d53db444-8473-a48c-179f-4baf13a97674@iogearbox.net> (raw)
In-Reply-To: <159303723962.11287.13309537171132420717.stgit@john-Precision-5820-Tower>

On 6/25/20 12:20 AM, John Fastabend 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.
> 
> v2: remove unneeded parens per Andrii's feedback
> 
> Fixes: 9e15db66136a1 ("bpf: Implement accurate raw_tp context access via BTF")
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>

Applied, thanks!

  reply	other threads:[~2020-06-25 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 22:20 [bpf PATCH] bpf: Do not allow btf_ctx_access with __int128 types John Fastabend
2020-06-25 15:01 ` Daniel Borkmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-23 17:13 [bpf PATCH] bpf: do " John Fastabend
2020-06-23 18:33 ` Andrii Nakryiko
2020-06-24 22:23   ` John Fastabend

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d53db444-8473-a48c-179f-4baf13a97674@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.