* Bumps solana_rbpf to v0.2.22
* Adjusts vm::Config and feature gates.
(cherry picked from commit 96c88d1a5e)
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
			
			
This commit is contained in:
		
							
								
								
									
										4
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							@@ -6288,9 +6288,9 @@ dependencies = [
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "solana_rbpf"
 | 
			
		||||
version = "0.2.21"
 | 
			
		||||
version = "0.2.22"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "8fb565d026461ba89d1d92cc36cf0882fba44076559c3bbed1e8a9888112b3d7"
 | 
			
		||||
checksum = "425e41726409233aa2b4e5063a94a8bc5861e6d59cf700cfd9dd142084437c6f"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "byteorder",
 | 
			
		||||
 "combine",
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ solana-config-program = { path = "../programs/config", version = "=1.9.6" }
 | 
			
		||||
solana-faucet = { path = "../faucet", version = "=1.9.6" }
 | 
			
		||||
solana-logger = { path = "../logger", version = "=1.9.6" }
 | 
			
		||||
solana-program-runtime = { path = "../program-runtime", version = "=1.9.6" }
 | 
			
		||||
solana_rbpf = "=0.2.21"
 | 
			
		||||
solana_rbpf = "=0.2.22"
 | 
			
		||||
solana-remote-wallet = { path = "../remote-wallet", version = "=1.9.6" }
 | 
			
		||||
solana-sdk = { path = "../sdk", version = "=1.9.6" }
 | 
			
		||||
solana-transaction-status = { path = "../transaction-status", version = "=1.9.6" }
 | 
			
		||||
 
 | 
			
		||||
@@ -1997,10 +1997,7 @@ fn read_and_verify_elf(program_location: &str) -> Result<Vec<u8>, Box<dyn std::e
 | 
			
		||||
        &program_data,
 | 
			
		||||
        Some(verifier::check),
 | 
			
		||||
        Config {
 | 
			
		||||
            reject_unresolved_syscalls: true,
 | 
			
		||||
            verify_mul64_imm_nonzero: false,
 | 
			
		||||
            verify_shift32_imm: true,
 | 
			
		||||
            reject_section_virtual_address_file_offset_mismatch: true,
 | 
			
		||||
            reject_broken_elfs: true,
 | 
			
		||||
            ..Config::default()
 | 
			
		||||
        },
 | 
			
		||||
        register_syscalls(&mut invoke_context).unwrap(),
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								programs/bpf/Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								programs/bpf/Cargo.lock
									
									
									
										generated
									
									
									
								
							@@ -3467,9 +3467,9 @@ dependencies = [
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "solana_rbpf"
 | 
			
		||||
version = "0.2.21"
 | 
			
		||||
version = "0.2.22"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "8fb565d026461ba89d1d92cc36cf0882fba44076559c3bbed1e8a9888112b3d7"
 | 
			
		||||
checksum = "425e41726409233aa2b4e5063a94a8bc5861e6d59cf700cfd9dd142084437c6f"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "byteorder 1.4.3",
 | 
			
		||||
 "combine",
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ solana-bpf-rust-realloc-invoke = { path = "rust/realloc_invoke", version = "=1.9
 | 
			
		||||
solana-cli-output = { path = "../../cli-output", version = "=1.9.6" }
 | 
			
		||||
solana-logger = { path = "../../logger", version = "=1.9.6" }
 | 
			
		||||
solana-measure = { path = "../../measure", version = "=1.9.6" }
 | 
			
		||||
solana_rbpf = "=0.2.21"
 | 
			
		||||
solana_rbpf = "=0.2.22"
 | 
			
		||||
solana-runtime = { path = "../../runtime", version = "=1.9.6" }
 | 
			
		||||
solana-program-runtime = { path = "../../program-runtime", version = "=1.9.6" }
 | 
			
		||||
solana-sdk = { path = "../../sdk", version = "=1.9.6" }
 | 
			
		||||
 
 | 
			
		||||
@@ -211,10 +211,7 @@ fn run_program(name: &str) -> u64 {
 | 
			
		||||
        let mut instruction_meter = ThisInstructionMeter { compute_meter };
 | 
			
		||||
        let config = Config {
 | 
			
		||||
            enable_instruction_tracing: true,
 | 
			
		||||
            reject_unresolved_syscalls: true,
 | 
			
		||||
            reject_section_virtual_address_file_offset_mismatch: true,
 | 
			
		||||
            verify_mul64_imm_nonzero: false,
 | 
			
		||||
            verify_shift32_imm: true,
 | 
			
		||||
            reject_broken_elfs: true,
 | 
			
		||||
            ..Config::default()
 | 
			
		||||
        };
 | 
			
		||||
        let mut executable = Executable::<BpfError, ThisInstructionMeter>::from_elf(
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ solana-measure = { path = "../../measure", version = "=1.9.6" }
 | 
			
		||||
solana-metrics = { path = "../../metrics", version = "=1.9.6" }
 | 
			
		||||
solana-program-runtime = { path = "../../program-runtime", version = "=1.9.6" }
 | 
			
		||||
solana-sdk = { path = "../../sdk", version = "=1.9.6" }
 | 
			
		||||
solana_rbpf = "=0.2.21"
 | 
			
		||||
solana_rbpf = "=0.2.22"
 | 
			
		||||
thiserror = "1.0"
 | 
			
		||||
 | 
			
		||||
[dev-dependencies]
 | 
			
		||||
 
 | 
			
		||||
@@ -41,10 +41,9 @@ use {
 | 
			
		||||
        clock::Clock,
 | 
			
		||||
        entrypoint::{HEAP_LENGTH, SUCCESS},
 | 
			
		||||
        feature_set::{
 | 
			
		||||
            cap_accounts_data_len, do_support_realloc, reduce_required_deploy_balance,
 | 
			
		||||
            reject_all_elf_rw, reject_deployment_of_unresolved_syscalls,
 | 
			
		||||
            reject_section_virtual_address_file_offset_mismatch, requestable_heap_size,
 | 
			
		||||
            start_verify_shift32_imm, stop_verify_mul64_imm_nonzero,
 | 
			
		||||
            cap_accounts_data_len, disable_bpf_deprecated_load_instructions,
 | 
			
		||||
            disable_bpf_unresolved_symbols_at_runtime, do_support_realloc,
 | 
			
		||||
            reduce_required_deploy_balance, requestable_heap_size,
 | 
			
		||||
        },
 | 
			
		||||
        instruction::{AccountMeta, InstructionError},
 | 
			
		||||
        keyed_account::{from_keyed_account, keyed_account_at_index, KeyedAccount},
 | 
			
		||||
@@ -127,23 +126,14 @@ pub fn create_executor(
 | 
			
		||||
        max_call_depth: compute_budget.max_call_depth,
 | 
			
		||||
        stack_frame_size: compute_budget.stack_frame_size,
 | 
			
		||||
        enable_instruction_tracing: log_enabled!(Trace),
 | 
			
		||||
        reject_unresolved_syscalls: reject_deployment_of_broken_elfs
 | 
			
		||||
        disable_deprecated_load_instructions: reject_deployment_of_broken_elfs
 | 
			
		||||
            && invoke_context
 | 
			
		||||
                .feature_set
 | 
			
		||||
                .is_active(&reject_deployment_of_unresolved_syscalls::id()),
 | 
			
		||||
        reject_section_virtual_address_file_offset_mismatch: reject_deployment_of_broken_elfs
 | 
			
		||||
            && invoke_context
 | 
			
		||||
                .is_active(&disable_bpf_deprecated_load_instructions::id()),
 | 
			
		||||
        disable_unresolved_symbols_at_runtime: invoke_context
 | 
			
		||||
            .feature_set
 | 
			
		||||
                .is_active(&reject_section_virtual_address_file_offset_mismatch::id()),
 | 
			
		||||
        verify_mul64_imm_nonzero: !invoke_context
 | 
			
		||||
            .feature_set
 | 
			
		||||
            .is_active(&stop_verify_mul64_imm_nonzero::id()),
 | 
			
		||||
        verify_shift32_imm: invoke_context
 | 
			
		||||
            .feature_set
 | 
			
		||||
            .is_active(&start_verify_shift32_imm::id()),
 | 
			
		||||
        reject_all_writable_sections: invoke_context
 | 
			
		||||
            .feature_set
 | 
			
		||||
            .is_active(&reject_all_elf_rw::id()),
 | 
			
		||||
            .is_active(&disable_bpf_unresolved_symbols_at_runtime::id()),
 | 
			
		||||
        reject_broken_elfs: reject_deployment_of_broken_elfs,
 | 
			
		||||
        ..Config::default()
 | 
			
		||||
    };
 | 
			
		||||
    let mut create_executor_metrics = executor_metrics::CreateMetrics::default();
 | 
			
		||||
 
 | 
			
		||||
@@ -17,5 +17,5 @@ solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.9.6
 | 
			
		||||
solana-logger = { path = "../logger", version = "=1.9.6" }
 | 
			
		||||
solana-program-runtime = { path = "../program-runtime", version = "=1.9.6" }
 | 
			
		||||
solana-sdk = { path = "../sdk", version = "=1.9.6" }
 | 
			
		||||
solana_rbpf = "=0.2.21"
 | 
			
		||||
solana_rbpf = "=0.2.22"
 | 
			
		||||
time = "0.3.5"
 | 
			
		||||
 
 | 
			
		||||
@@ -137,14 +137,6 @@ pub mod spl_token_v2_set_authority_fix {
 | 
			
		||||
    solana_sdk::declare_id!("FToKNBYyiF4ky9s8WsmLBXHCht17Ek7RXaLZGHzzQhJ1");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod stop_verify_mul64_imm_nonzero {
 | 
			
		||||
    solana_sdk::declare_id!("EHFwHg2vhwUb7ifm7BuY9RMbsyt1rS1rUii7yeDJtGnN");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod start_verify_shift32_imm {
 | 
			
		||||
    solana_sdk::declare_id!("CqvdhqAYMc6Eq6tjW3H42Qg39TK2SCsL8ydMsC363PRp");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod merge_nonce_error_into_system_error {
 | 
			
		||||
    solana_sdk::declare_id!("21AWDosvp3pBamFW91KB35pNoaoZVTM7ess8nr2nt53B");
 | 
			
		||||
}
 | 
			
		||||
@@ -239,14 +231,6 @@ pub mod add_compute_budget_program {
 | 
			
		||||
    solana_sdk::declare_id!("4d5AKtxoh93Dwm1vHXUU3iRATuMndx1c431KgT2td52r");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod reject_deployment_of_unresolved_syscalls {
 | 
			
		||||
    solana_sdk::declare_id!("DqniU3MfvdpU3yhmNF1RKeaM5TZQELZuyFGosASRVUoy");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod reject_section_virtual_address_file_offset_mismatch {
 | 
			
		||||
    solana_sdk::declare_id!("5N4NikcJLEiZNqwndhNyvZw15LvFXp1oF7AJQTNTZY5k");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod nonce_must_be_writable {
 | 
			
		||||
    solana_sdk::declare_id!("BiCU7M5w8ZCMykVSyhZ7Q3m2SWoR2qrEQ86ERcDX77ME");
 | 
			
		||||
}
 | 
			
		||||
@@ -271,10 +255,6 @@ pub mod evict_invalid_stakes_cache_entries {
 | 
			
		||||
    solana_sdk::declare_id!("EMX9Q7TVFAmQ9V1CggAkhMzhXSg8ECp7fHrWQX2G1chf");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod reject_all_elf_rw {
 | 
			
		||||
    solana_sdk::declare_id!("DeMpxgMq51j3rZfNK2hQKZyXknQvqevPSFPJFNTbXxsS");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod cap_accounts_data_len {
 | 
			
		||||
    solana_sdk::declare_id!("capRxUrBjNkkCpjrJxPGfPaWijB7q3JoDfsWXAnt46r");
 | 
			
		||||
}
 | 
			
		||||
@@ -307,6 +287,14 @@ pub mod bank_tranaction_count_fix {
 | 
			
		||||
    solana_sdk::declare_id!("Vo5siZ442SaZBKPXNocthiXysNviW4UYPwRFggmbgAp");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod disable_bpf_deprecated_load_instructions {
 | 
			
		||||
    solana_sdk::declare_id!("3XgNukcZWf9o3HdA3fpJbm94XFc4qpvTXc8h1wxYwiPi");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod disable_bpf_unresolved_symbols_at_runtime {
 | 
			
		||||
    solana_sdk::declare_id!("4yuaYAj2jGMGTh1sSmi4G2eFscsDq8qjugJXZoBN6YEa");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lazy_static! {
 | 
			
		||||
    /// Map of feature identifiers to user-visible description
 | 
			
		||||
    pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
 | 
			
		||||
@@ -336,8 +324,6 @@ lazy_static! {
 | 
			
		||||
        (libsecp256k1_0_5_upgrade_enabled::id(), "upgrade libsecp256k1 to v0.5.0"),
 | 
			
		||||
        (tx_wide_compute_cap::id(), "transaction wide compute cap"),
 | 
			
		||||
        (spl_token_v2_set_authority_fix::id(), "spl-token set_authority fix"),
 | 
			
		||||
        (stop_verify_mul64_imm_nonzero::id(), "sets rbpf vm config verify_mul64_imm_nonzero to false"),
 | 
			
		||||
        (start_verify_shift32_imm::id(), "sets rbpf vm config verify_shift32_imm to true"),
 | 
			
		||||
        (merge_nonce_error_into_system_error::id(), "merge NonceError into SystemError"),
 | 
			
		||||
        (disable_fees_sysvar::id(), "disable fees sysvar"),
 | 
			
		||||
        (stake_merge_with_unmatched_credits_observed::id(), "allow merging active stakes with unmatched credits_observed #18985"),
 | 
			
		||||
@@ -361,15 +347,12 @@ lazy_static! {
 | 
			
		||||
        (requestable_heap_size::id(), "Requestable heap frame size"),
 | 
			
		||||
        (disable_fee_calculator::id(), "deprecate fee calculator"),
 | 
			
		||||
        (add_compute_budget_program::id(), "Add compute_budget_program"),
 | 
			
		||||
        (reject_deployment_of_unresolved_syscalls::id(), "Reject deployment of programs with unresolved syscall symbols"),
 | 
			
		||||
        (reject_section_virtual_address_file_offset_mismatch::id(), "enforce section virtual addresses and file offsets in ELF to be equal"),
 | 
			
		||||
        (nonce_must_be_writable::id(), "nonce must be writable"),
 | 
			
		||||
        (spl_token_v3_3_0_release::id(), "spl-token v3.3.0 release"),
 | 
			
		||||
        (leave_nonce_on_success::id(), "leave nonce as is on success"),
 | 
			
		||||
        (reject_empty_instruction_without_program::id(), "fail instructions which have native_loader as program_id directly"),
 | 
			
		||||
        (reject_non_rent_exempt_vote_withdraws::id(), "fail vote withdraw instructions which leave the account non-rent-exempt"),
 | 
			
		||||
        (evict_invalid_stakes_cache_entries::id(), "evict invalid stakes cache entries on epoch boundaries"),
 | 
			
		||||
        (reject_all_elf_rw::id(), "reject all read-write data in program elfs"),
 | 
			
		||||
        (cap_accounts_data_len::id(), "cap the accounts data len"),
 | 
			
		||||
        (max_tx_account_locks::id(), "enforce max number of locked accounts per transaction"),
 | 
			
		||||
        (require_rent_exempt_accounts::id(), "require all new transaction accounts with data to be rent-exempt"),
 | 
			
		||||
@@ -378,6 +361,8 @@ lazy_static! {
 | 
			
		||||
        (update_syscall_base_costs::id(), "Update syscall base costs"),
 | 
			
		||||
        (reject_vote_account_close_unless_zero_credit_epoch::id(), "fail vote account withdraw to 0 unless account earned 0 credits in last completed epoch"),
 | 
			
		||||
        (bank_tranaction_count_fix::id(), "Fixes Bank::transaction_count to include all committed transactions, not just successful ones"),
 | 
			
		||||
        (disable_bpf_deprecated_load_instructions::id(), "Disable ldabs* and ldind* BPF instructions"),
 | 
			
		||||
        (disable_bpf_unresolved_symbols_at_runtime::id(), "Disable reporting of unresolved BPF symbols at runtime"),
 | 
			
		||||
        /*************** ADD NEW FEATURES HERE ***************/
 | 
			
		||||
    ]
 | 
			
		||||
    .iter()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user