public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org, ast@kernel.org,  daniel@iogearbox.net,
	martin.lau@kernel.org
Cc: kernel-team@meta.com, Hao Sun <sunhao.th@gmail.com>
Subject: Re: [PATCH bpf-next 1/4] bpf: handle ldimm64 properly in check_cfg()
Date: Fri, 10 Nov 2023 00:25:57 +0200	[thread overview]
Message-ID: <c55eea6901c2ba2d404717b69c8a1e5b885991eb.camel@gmail.com> (raw)
In-Reply-To: <20231108231152.3583545-2-andrii@kernel.org>

On Wed, 2023-11-08 at 15:11 -0800, Andrii Nakryiko wrote:
> ldimm64 instructions are 16-byte long, and so have to be handled
> appropriately in check_cfg(), just like the rest of BPF verifier does.
> 
> This has implications in three places:
>   - when determining next instruction for non-jump instructions;
>   - when determining next instruction for callback address ldimm64
>     instructions (in visit_func_call_insn());
>   - when checking for unreachable instructions, where second half of
>     ldimm64 is expected to be unreachable;
> 
> We take this also as an opportunity to report jump into the middle of
> ldimm64. And adjust few test_verifier tests accordingly.
> 
> Reported-by: Hao Sun <sunhao.th@gmail.com>
> Fixes: 475fb78fbf48 ("bpf: verifier (add branch/goto checks)")
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

Acked-by: Eduard Zingerman <eddyz87@gmail.com>

  reply	other threads:[~2023-11-09 22:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 23:11 [PATCH bpf-next 0/4] BPF control flow graph and precision backtrack fixes Andrii Nakryiko
2023-11-08 23:11 ` [PATCH bpf-next 1/4] bpf: handle ldimm64 properly in check_cfg() Andrii Nakryiko
2023-11-09 22:25   ` Eduard Zingerman [this message]
2023-11-08 23:11 ` [PATCH bpf-next 2/4] bpf: fix precision backtracking instruction iteration Andrii Nakryiko
2023-11-09 17:20   ` Eduard Zingerman
2023-11-09 23:18     ` Andrii Nakryiko
2023-11-09 23:28       ` Andrii Nakryiko
2023-11-09 23:37         ` Eduard Zingerman
2023-11-08 23:11 ` [PATCH bpf-next 3/4] bpf: fix control-flow graph checking in privileged mode Andrii Nakryiko
2023-11-09 22:00   ` Eduard Zingerman
2023-11-09 23:25     ` Andrii Nakryiko
2023-11-10  1:26   ` Alexei Starovoitov
2023-11-10  3:41     ` Andrii Nakryiko
2023-11-10  4:08       ` Alexei Starovoitov
2023-11-10  5:31         ` Andrii Nakryiko
2023-11-10  5:33           ` Andrii Nakryiko
2023-11-08 23:11 ` [PATCH bpf-next 4/4] selftests/bpf: add more test cases for check_cfg() Andrii Nakryiko
2023-11-09 22:21   ` Eduard Zingerman

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=c55eea6901c2ba2d404717b69c8a1e5b885991eb.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=sunhao.th@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox