mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Hao Luo <haoluo@google.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andriin@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>
Subject: Re: [PATCH v2] selftests/bpf: Fix test_verifier after introducing resolve_pseudo_ldimm64
Date: Tue, 6 Oct 2020 19:04:01 -0700	[thread overview]
Message-ID: <20201007020401.wsbeli3dbz7fumal@ast-mbp> (raw)
In-Reply-To: <20201007012313.2778426-1-haoluo@google.com>

On Tue, Oct 06, 2020 at 06:23:13PM -0700, Hao Luo wrote:
> Commit 4976b718c355 ("bpf: Introduce pseudo_btf_id") switched
> the order of check_subprogs() and resolve_pseudo_ldimm() in
> the verifier. Now an empty prog expects to see the error "last
> insn is not an the prog of a single invalid ldimm exit or jmp"
> instead, because the check for subprogs comes first. It's now
> pointless to validate that half of ldimm64 won't be the last
> instruction.
> 
> Tested:
>  # ./test_verifier
>  Summary: 1129 PASSED, 537 SKIPPED, 0 FAILED
>  and the full set of bpf selftests.
> 
> Fixes: 4976b718c355 ("bpf: Introduce pseudo_btf_id")
> Signed-off-by: Hao Luo <haoluo@google.com>
> ---
> Changelog in v2:
>  - Remove the original test_verifier ld_imm64 test4
>  - Updated commit message.
> 
>  tools/testing/selftests/bpf/verifier/basic.c  |  2 +-
>  .../testing/selftests/bpf/verifier/ld_imm64.c | 24 +++++++------------
>  2 files changed, 9 insertions(+), 17 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/verifier/basic.c b/tools/testing/selftests/bpf/verifier/basic.c
> index b8d18642653a..de84f0d57082 100644
> --- a/tools/testing/selftests/bpf/verifier/basic.c
> +++ b/tools/testing/selftests/bpf/verifier/basic.c
> @@ -2,7 +2,7 @@
>  	"empty prog",
>  	.insns = {
>  	},
> -	.errstr = "unknown opcode 00",
> +	.errstr = "last insn is not an exit or jmp",
>  	.result = REJECT,
>  },
>  {
> diff --git a/tools/testing/selftests/bpf/verifier/ld_imm64.c b/tools/testing/selftests/bpf/verifier/ld_imm64.c
> index 3856dba733e9..ed6a34991216 100644
> --- a/tools/testing/selftests/bpf/verifier/ld_imm64.c
> +++ b/tools/testing/selftests/bpf/verifier/ld_imm64.c
> @@ -54,21 +54,13 @@
>  	"test5 ld_imm64",
>  	.insns = {
>  	BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 0),
> -	},
> -	.errstr = "invalid bpf_ld_imm64 insn",
> -	.result = REJECT,
> -},
> -{
> -	"test6 ld_imm64",
> -	.insns = {
> -	BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 0),
>  	BPF_RAW_INSN(0, 0, 0, 0, 0),
>  	BPF_EXIT_INSN(),
>  	},
>  	.result = ACCEPT,
>  },
>  {
> -	"test7 ld_imm64",
> +	"test6 ld_imm64",
>  	.insns = {
>  	BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 1),
>  	BPF_RAW_INSN(0, 0, 0, 0, 1),
> @@ -78,7 +70,7 @@
>  	.retval = 1,
>  },
>  {
> -	"test8 ld_imm64",
> +	"test7 ld_imm64",

imo that's too much churn to rename all of them.
Just delete one.

  reply	other threads:[~2020-10-07  2:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07  1:23 Hao Luo
2020-10-07  2:04 ` Alexei Starovoitov [this message]
2020-10-07  2:29   ` Hao Luo

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=20201007020401.wsbeli3dbz7fumal@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.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

all inboxes | Powered by JetHome®