Skip to content

Commit

Permalink
Rebase onto main
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte committed Oct 11, 2024
1 parent 3edd35e commit 9596526
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions tests/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
];

Expand All @@ -444,7 +444,7 @@ fn return_instr() {
.unwrap();
let result = executable.verify::<RequisiteVerifier>();
if sbpf_version == SBPFVersion::V2 {
assert_error!(result, "VerifierError(UnknownOpCode(149, 1))");
assert!(result.is_ok());
} else {
assert_error!(result, "VerifierError(UnknownOpCode(157, 2))");
}
Expand Down

0 comments on commit 9596526

Please sign in to comment.