From 9596526305aec899a5c85e24852715fa5487d59e Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 11 Oct 2024 16:26:56 -0300 Subject: [PATCH] Rebase onto main --- src/verifier.rs | 1 + tests/verifier.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/verifier.rs b/src/verifier.rs index e9a28024..6f46a0a3 100644 --- a/src/verifier.rs +++ b/src/verifier.rs @@ -392,6 +392,7 @@ impl Verifier for RequisiteVerifier { ebpf::CALL_REG => { check_callx_register(&insn, insn_ptr, sbpf_version)?; }, ebpf::EXIT if !sbpf_version.static_syscalls() => {}, ebpf::RETURN if sbpf_version.static_syscalls() => {}, + ebpf::SYSCALL if sbpf_version.static_syscalls() => {}, _ => { return Err(VerifierError::UnknownOpCode(insn.opc, insn_ptr)); diff --git a/tests/verifier.rs b/tests/verifier.rs index a7cf9421..5fa54218 100644 --- a/tests/verifier.rs +++ b/tests/verifier.rs @@ -431,7 +431,7 @@ fn return_instr() { for sbpf_version in [SBPFVersion::V1, SBPFVersion::V2] { let prog = &[ 0xbf, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // mov64 r0, 2 - 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exit + 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exit (v1), syscall (v2) 0x9d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // return ]; @@ -444,7 +444,7 @@ fn return_instr() { .unwrap(); let result = executable.verify::(); if sbpf_version == SBPFVersion::V2 { - assert_error!(result, "VerifierError(UnknownOpCode(149, 1))"); + assert!(result.is_ok()); } else { assert_error!(result, "VerifierError(UnknownOpCode(157, 2))"); }