Skip to content

Commit

Permalink
Remove checks for activated feature check_physical_overlapping (solan…
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrod authored and nickfrosty committed Jan 4, 2023
1 parent 89b19df commit d76450a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 1 addition & 7 deletions programs/bpf_loader/src/syscalls/mem_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ declare_syscall!(
) -> Result<u64, EbpfError> {
mem_op_consume(invoke_context, n)?;

let do_check_physical_overlapping = invoke_context
.feature_set
.is_active(&check_physical_overlapping::id());

if !is_nonoverlapping(src_addr, n, dst_addr, n) {
return Err(SyscallError::CopyOverlapping.into());
}
Expand All @@ -46,9 +42,7 @@ declare_syscall!(
invoke_context.get_check_size(),
)?
.as_ptr();
if do_check_physical_overlapping
&& !is_nonoverlapping(src_ptr as usize, n as usize, dst_ptr as usize, n as usize)
{
if !is_nonoverlapping(src_ptr as usize, n as usize, dst_ptr as usize, n as usize) {
unsafe {
std::ptr::copy(src_ptr, dst_ptr, n as usize);
}
Expand Down
8 changes: 4 additions & 4 deletions programs/bpf_loader/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ use {
entrypoint::{BPF_ALIGN_OF_U128, MAX_PERMITTED_DATA_INCREASE, SUCCESS},
feature_set::FeatureSet,
feature_set::{
self, blake3_syscall_enabled, check_physical_overlapping,
check_syscall_outputs_do_not_overlap, curve25519_syscall_enabled,
disable_cpi_setting_executable_and_rent_epoch, disable_fees_sysvar,
enable_alt_bn128_syscall, enable_early_verification_of_account_modifications,
self, blake3_syscall_enabled, check_syscall_outputs_do_not_overlap,
curve25519_syscall_enabled, disable_cpi_setting_executable_and_rent_epoch,
disable_fees_sysvar, enable_alt_bn128_syscall,
enable_early_verification_of_account_modifications,
error_on_syscall_bpf_function_hash_collisions, libsecp256k1_0_5_upgrade_enabled,
limit_secp256k1_recovery_id, reject_callx_r10,
stop_sibling_instruction_search_at_parent,
Expand Down

0 comments on commit d76450a

Please sign in to comment.