Skip to content

Commit

Permalink
check_syscall_outputs_do_not_overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed May 22, 2023
1 parent dd5c55a commit e95f530
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 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 {
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,
reject_callx_r10, stop_sibling_instruction_search_at_parent,
stop_truncating_strings_in_syscalls, switch_to_new_elf_parser,
Expand Down Expand Up @@ -685,10 +685,7 @@ declare_syscall!(
std::mem::size_of_val(bump_seed_ref),
address.as_ptr() as usize,
std::mem::size_of::<Pubkey>(),
) && invoke_context
.feature_set
.is_active(&check_syscall_outputs_do_not_overlap::id())
{
) {
return Err(SyscallError::CopyOverlapping.into());
}
*bump_seed_ref = bump_seed[0];
Expand Down Expand Up @@ -1438,10 +1435,7 @@ declare_syscall!(
length as usize,
program_id_result as *const _ as usize,
std::mem::size_of::<Pubkey>(),
) && invoke_context
.feature_set
.is_active(&check_syscall_outputs_do_not_overlap::id())
{
) {
return Err(SyscallError::CopyOverlapping.into());
}

Expand Down Expand Up @@ -1530,7 +1524,7 @@ declare_syscall!(
invoke_context.get_check_size(),
)?;

if (!is_nonoverlapping(
if !is_nonoverlapping(
result_header as *const _ as usize,
std::mem::size_of::<ProcessedSiblingInstruction>(),
program_id as *const _ as usize,
Expand Down Expand Up @@ -1563,10 +1557,7 @@ declare_syscall!(
accounts.as_ptr() as usize,
std::mem::size_of::<AccountMeta>()
.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());
}

Expand Down

0 comments on commit e95f530

Please sign in to comment.