Skip to content

Commit

Permalink
Removes Config::reject_callx_r10
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Sep 26, 2024
1 parent 57139e9 commit d295d23
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions fuzz/fuzz_targets/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub struct ConfigTemplate {
enable_stack_frame_gaps: bool,
enable_symbol_and_section_labels: bool,
sanitize_user_provided_values: bool,
reject_callx_r10: bool,
optimize_rodata: bool,
}

Expand All @@ -26,7 +25,6 @@ impl<'a> Arbitrary<'a> for ConfigTemplate {
enable_stack_frame_gaps: bools & (1 << 0) != 0,
enable_symbol_and_section_labels: bools & (1 << 1) != 0,
sanitize_user_provided_values: bools & (1 << 3) != 0,
reject_callx_r10: bools & (1 << 6) != 0,
optimize_rodata: bools & (1 << 9) != 0,
})
}
Expand All @@ -49,7 +47,6 @@ impl From<ConfigTemplate> for Config {
enable_stack_frame_gaps,
enable_symbol_and_section_labels,
sanitize_user_provided_values,
reject_callx_r10,
optimize_rodata,
} => Config {
max_call_depth,
Expand All @@ -58,7 +55,6 @@ impl From<ConfigTemplate> for Config {
enable_symbol_and_section_labels,
noop_instruction_rate,
sanitize_user_provided_values,
reject_callx_r10,
optimize_rodata,
..Default::default()
},
Expand Down
2 changes: 1 addition & 1 deletion src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fn check_callx_register(
} else {
insn.imm
};
if !(0..=10).contains(&reg) || (reg == 10 && config.reject_callx_r10) {
if !(0..10).contains(&reg) {
return Err(VerifierError::InvalidRegister(insn_ptr));
}
Ok(())
Expand Down
3 changes: 0 additions & 3 deletions src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ pub struct Config {
pub sanitize_user_provided_values: bool,
/// Throw ElfError::SymbolHashCollision when a BPF function collides with a registered syscall
pub external_internal_function_hash_collision: bool,
/// Have the verifier reject "callx r10"
pub reject_callx_r10: bool,
/// Avoid copying read only sections when possible
pub optimize_rodata: bool,
/// Use aligned memory mapping
Expand Down Expand Up @@ -106,7 +104,6 @@ impl Default for Config {
noop_instruction_rate: 256,
sanitize_user_provided_values: true,
external_internal_function_hash_collision: true,
reject_callx_r10: true,
optimize_rodata: true,
aligned_memory_mapping: true,
enabled_sbpf_versions: SBPFVersion::V1..=SBPFVersion::V2,
Expand Down

0 comments on commit d295d23

Please sign in to comment.