From 5823ef19593964b113a66a0f012ea5abfceb1372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Wed, 24 May 2023 09:22:42 +0200 Subject: [PATCH] Cleanup - check_syscall_outputs_do_not_overlap (#31771) check_syscall_outputs_do_not_overlap --- programs/bpf_loader/src/syscalls/mod.rs | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/programs/bpf_loader/src/syscalls/mod.rs b/programs/bpf_loader/src/syscalls/mod.rs index 449668a3a10e8e..296f941e017631 100644 --- a/programs/bpf_loader/src/syscalls/mod.rs +++ b/programs/bpf_loader/src/syscalls/mod.rs @@ -33,10 +33,10 @@ use { feature_set::bpf_account_data_direct_mapping, feature_set::FeatureSet, feature_set::{ - self, blake3_syscall_enabled, check_syscall_outputs_do_not_overlap, - curve25519_syscall_enabled, disable_cpi_setting_executable_and_rent_epoch, - disable_deploy_of_alloc_free_syscall, disable_fees_sysvar, enable_alt_bn128_syscall, - enable_big_mod_exp_syscall, enable_early_verification_of_account_modifications, + self, blake3_syscall_enabled, curve25519_syscall_enabled, + disable_cpi_setting_executable_and_rent_epoch, disable_deploy_of_alloc_free_syscall, + disable_fees_sysvar, enable_alt_bn128_syscall, enable_big_mod_exp_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, stop_truncating_strings_in_syscalls, @@ -686,10 +686,7 @@ declare_syscall!( std::mem::size_of_val(bump_seed_ref), address.as_ptr() as usize, std::mem::size_of::(), - ) && invoke_context - .feature_set - .is_active(&check_syscall_outputs_do_not_overlap::id()) - { + ) { return Err(SyscallError::CopyOverlapping.into()); } *bump_seed_ref = bump_seed[0]; @@ -1446,10 +1443,7 @@ declare_syscall!( length as usize, program_id_result as *const _ as usize, std::mem::size_of::(), - ) && invoke_context - .feature_set - .is_active(&check_syscall_outputs_do_not_overlap::id()) - { + ) { return Err(SyscallError::CopyOverlapping.into()); } @@ -1538,7 +1532,7 @@ declare_syscall!( invoke_context.get_check_size(), )?; - if (!is_nonoverlapping( + if !is_nonoverlapping( result_header as *const _ as usize, std::mem::size_of::(), program_id as *const _ as usize, @@ -1571,10 +1565,7 @@ declare_syscall!( accounts.as_ptr() as usize, std::mem::size_of::() .saturating_mul(result_header.accounts_len as usize), - )) && invoke_context - .feature_set - .is_active(&check_syscall_outputs_do_not_overlap::id()) - { + ) { return Err(SyscallError::CopyOverlapping.into()); }