Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ pub fn execute_program(
check_mem_store(x as u64, 8, insn_ptr)?;
x.write_unaligned(reg[_src]);
},
ebpf::ST_W_XADD => unimplemented!(),
ebpf::ST_DW_XADD => unimplemented!(),
ebpf::ST_W_XADD => Err(Error::other(format!("Error: XADD instructions are not supported (insn #{})", insn_ptr - 1)))?,
ebpf::ST_DW_XADD => Err(Error::other(format!("Error: XADD instructions are not supported (insn #{})", insn_ptr - 1)))?,

// BPF_ALU class
// TODO Check how overflow works in kernel. Should we &= U32MAX all src register value
Expand Down Expand Up @@ -439,7 +439,7 @@ pub fn execute_program(
}
}
}
ebpf::TAIL_CALL => unimplemented!(),
ebpf::TAIL_CALL => Err(Error::other(format!("Error: TAIL_CALL is not supported (insn #{})", insn_ptr - 1)))?,
ebpf::EXIT => {
if stack_frame_idx > 0 {
stack_frame_idx -= 1;
Expand Down
6 changes: 3 additions & 3 deletions src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ pub fn check(prog: &[u8]) -> Result<(), Error> {
ebpf::ST_H_REG => store = true,
ebpf::ST_W_REG => store = true,
ebpf::ST_DW_REG => store = true,
ebpf::ST_W_XADD => { unimplemented!(); },
ebpf::ST_DW_XADD => { unimplemented!(); },
ebpf::ST_W_XADD => { reject(format!("XADD instructions are not supported (insn #{insn_ptr:?})"))?; },
ebpf::ST_DW_XADD => { reject(format!("XADD instructions are not supported (insn #{insn_ptr:?})"))?; },

// BPF_ALU class
ebpf::ADD32_IMM => {},
Expand Down Expand Up @@ -275,7 +275,7 @@ pub fn check(prog: &[u8]) -> Result<(), Error> {
_ => { reject(format!("unsupported call type #{src:?} (insn #{insn_ptr:?})"))?; }
}
},
ebpf::TAIL_CALL => { unimplemented!() },
ebpf::TAIL_CALL => { reject(format!("TAIL_CALL is not supported (insn #{insn_ptr:?})"))?; },
ebpf::EXIT => {},

_ => {
Expand Down
Loading