committed by
Michael Vines
parent
ef626e144d
commit
a09e8397fb
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -5887,9 +5887,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana_rbpf"
|
||||
version = "0.2.11"
|
||||
version = "0.2.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c1c5bdfa63c68d848d95024c7f4335bae4b1917f7df2e48e2d945f4664a8b45"
|
||||
checksum = "c44596a3613a44f76a7f6e5205464a1e78d1529fa19e8eacde0b9e55a6387f50"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"combine",
|
||||
|
@ -40,7 +40,7 @@ solana-config-program = { path = "../programs/config", version = "=1.8.11" }
|
||||
solana-faucet = { path = "../faucet", version = "=1.8.11" }
|
||||
solana-logger = { path = "../logger", version = "=1.8.11" }
|
||||
solana-net-utils = { path = "../net-utils", version = "=1.8.11" }
|
||||
solana_rbpf = "=0.2.11"
|
||||
solana_rbpf = "=0.2.12"
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.11" }
|
||||
solana-sdk = { path = "../sdk", version = "=1.8.11" }
|
||||
solana-transaction-status = { path = "../transaction-status", version = "=1.8.11" }
|
||||
|
@ -9,7 +9,7 @@ use bip39::{Language, Mnemonic, MnemonicType, Seed};
|
||||
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
|
||||
use log::*;
|
||||
use solana_account_decoder::{UiAccountEncoding, UiDataSliceConfig};
|
||||
use solana_bpf_loader_program::{bpf_verifier, BpfError, ThisInstructionMeter};
|
||||
use solana_bpf_loader_program::{BpfError, ThisInstructionMeter};
|
||||
use solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*};
|
||||
use solana_cli_output::{
|
||||
CliProgram, CliProgramAccountType, CliProgramAuthority, CliProgramBuffer, CliProgramId,
|
||||
@ -24,7 +24,10 @@ use solana_client::{
|
||||
rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType},
|
||||
tpu_client::{TpuClient, TpuClientConfig},
|
||||
};
|
||||
use solana_rbpf::vm::{Config, Executable};
|
||||
use solana_rbpf::{
|
||||
verifier,
|
||||
vm::{Config, Executable},
|
||||
};
|
||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
@ -1987,7 +1990,7 @@ fn read_and_verify_elf(program_location: &str) -> Result<Vec<u8>, Box<dyn std::e
|
||||
// Verify the program
|
||||
<dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(
|
||||
&program_data,
|
||||
Some(|x| bpf_verifier::check(x)),
|
||||
Some(|x| verifier::check(x)),
|
||||
Config::default(),
|
||||
)
|
||||
.map_err(|err| format!("ELF error: {}", err))?;
|
||||
|
4
programs/bpf/Cargo.lock
generated
4
programs/bpf/Cargo.lock
generated
@ -3699,9 +3699,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana_rbpf"
|
||||
version = "0.2.11"
|
||||
version = "0.2.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c1c5bdfa63c68d848d95024c7f4335bae4b1917f7df2e48e2d945f4664a8b45"
|
||||
checksum = "c44596a3613a44f76a7f6e5205464a1e78d1529fa19e8eacde0b9e55a6387f50"
|
||||
dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
"combine",
|
||||
|
@ -30,7 +30,7 @@ solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.8.11" }
|
||||
solana-cli-output = { path = "../../cli-output", version = "=1.8.11" }
|
||||
solana-logger = { path = "../../logger", version = "=1.8.11" }
|
||||
solana-measure = { path = "../../measure", version = "=1.8.11" }
|
||||
solana_rbpf = "=0.2.11"
|
||||
solana_rbpf = "=0.2.12"
|
||||
solana-runtime = { path = "../../runtime", version = "=1.8.11" }
|
||||
solana-sdk = { path = "../../sdk", version = "=1.8.11" }
|
||||
solana-transaction-status = { path = "../../transaction-status", version = "=1.8.11" }
|
||||
|
@ -22,7 +22,7 @@ sha3 = "0.9.1"
|
||||
solana-measure = { path = "../../measure", version = "=1.8.11" }
|
||||
solana-runtime = { path = "../../runtime", version = "=1.8.11" }
|
||||
solana-sdk = { path = "../../sdk", version = "=1.8.11" }
|
||||
solana_rbpf = "=0.2.11"
|
||||
solana_rbpf = "=0.2.12"
|
||||
thiserror = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -1,7 +1,6 @@
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
pub mod alloc;
|
||||
pub mod allocator_bump;
|
||||
pub mod bpf_verifier;
|
||||
pub mod deprecated;
|
||||
pub mod serialization;
|
||||
pub mod syscalls;
|
||||
@ -10,7 +9,6 @@ pub mod upgradeable_with_jit;
|
||||
pub mod with_jit;
|
||||
|
||||
use crate::{
|
||||
bpf_verifier::VerifierError,
|
||||
serialization::{deserialize_parameters, serialize_parameters},
|
||||
syscalls::SyscallError,
|
||||
};
|
||||
@ -22,6 +20,7 @@ use solana_rbpf::{
|
||||
error::{EbpfError, UserDefinedError},
|
||||
memory_region::MemoryRegion,
|
||||
static_analysis::Analysis,
|
||||
verifier::{self, VerifierError},
|
||||
vm::{Config, EbpfVm, Executable, InstructionMeter},
|
||||
};
|
||||
use solana_runtime::message_processor::MessageProcessor;
|
||||
@ -100,8 +99,8 @@ pub fn create_executor(
|
||||
let (_, elf_bytes) = executable
|
||||
.get_text_bytes()
|
||||
.map_err(|e| map_ebpf_error(invoke_context, e))?;
|
||||
bpf_verifier::check(elf_bytes)
|
||||
.map_err(|e| map_ebpf_error(invoke_context, EbpfError::UserError(e)))?;
|
||||
verifier::check(elf_bytes)
|
||||
.map_err(|e| map_ebpf_error(invoke_context, EbpfError::UserError(e.into())))?;
|
||||
executable.set_syscall_registry(syscall_registry);
|
||||
if use_jit {
|
||||
if let Err(err) = executable.jit_compile() {
|
||||
@ -1067,12 +1066,12 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "VerifierError(LDDWCannotBeLast)")]
|
||||
#[should_panic(expected = "LDDWCannotBeLast")]
|
||||
fn test_bpf_loader_check_load_dw() {
|
||||
let prog = &[
|
||||
0x18, 0x00, 0x00, 0x00, 0x88, 0x77, 0x66, 0x55, // first half of lddw
|
||||
];
|
||||
bpf_verifier::check(prog).unwrap();
|
||||
verifier::check(prog).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user