netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] selftests/bpf: Fix test_verifier after introducing resolve_pseudo_ldimm64
@ 2020-10-07  2:28 Hao Luo
  2020-10-07  3:20 ` patchwork-bot+bpf
  0 siblings, 1 reply; 2+ messages in thread
From: Hao Luo @ 2020-10-07  2:28 UTC (permalink / raw)
  To: netdev, bpf, linux-kernel
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Hao Luo

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 v3:
 - Remove without renaming the rest

Changelog in v2:
 - Remove the test instead of modifying the err msg.

 tools/testing/selftests/bpf/verifier/basic.c    | 2 +-
 tools/testing/selftests/bpf/verifier/ld_imm64.c | 8 --------
 2 files changed, 1 insertion(+), 9 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..f9297900cea6 100644
--- a/tools/testing/selftests/bpf/verifier/ld_imm64.c
+++ b/tools/testing/selftests/bpf/verifier/ld_imm64.c
@@ -50,14 +50,6 @@
 	.errstr = "invalid bpf_ld_imm64 insn",
 	.result = REJECT,
 },
-{
-	"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 = {
-- 
2.28.0.806.g8561365e88-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] selftests/bpf: Fix test_verifier after introducing resolve_pseudo_ldimm64
  2020-10-07  2:28 [PATCH v3] selftests/bpf: Fix test_verifier after introducing resolve_pseudo_ldimm64 Hao Luo
@ 2020-10-07  3:20 ` patchwork-bot+bpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bpf @ 2020-10-07  3:20 UTC (permalink / raw)
  To: Hao Luo
  Cc: netdev, bpf, linux-kernel, ast, andriin, daniel, kafai,
	songliubraving, yhs, john.fastabend, kpsingh

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

On Tue,  6 Oct 2020 19:28:57 -0700 you 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.
> 
> [...]

Here is the summary with links:
  - [v3] selftests/bpf: Fix test_verifier after introducing resolve_pseudo_ldimm64
    https://git.kernel.org/bpf/bpf-next/c/bf88a80a0407

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-07  3:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07  2:28 [PATCH v3] selftests/bpf: Fix test_verifier after introducing resolve_pseudo_ldimm64 Hao Luo
2020-10-07  3:20 ` patchwork-bot+bpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).