Skip to content

Commit

Permalink
[core] check for excessive secp256r1 signature verification in the ba…
Browse files Browse the repository at this point in the history
…nking stage (#3938)
  • Loading branch information
samkim-crypto authored Dec 6, 2024
1 parent ce4a52d commit 18564ab
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ solana-runtime = { workspace = true }
solana-runtime-transaction = { workspace = true }
solana-sanitize = { workspace = true }
solana-sdk = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-send-transaction-service = { workspace = true }
solana-short-vec = { workspace = true }
solana-streamer = { workspace = true }
Expand Down
6 changes: 5 additions & 1 deletion core/src/banking_stage/packet_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use {
solana_sdk::{
ed25519_program, feature_set::FeatureSet, saturating_add_assign, secp256k1_program,
},
solana_sdk_ids::secp256r1_program,
thiserror::Error,
};

Expand Down Expand Up @@ -48,7 +49,10 @@ impl ImmutableDeserializedPacket {
pub fn check_excessive_precompiles(&self) -> Result<(), PacketFilterFailure> {
let mut num_precompile_signatures: u64 = 0;
for (program_id, ix) in self.transaction().get_message().program_instructions_iter() {
if secp256k1_program::check_id(program_id) || ed25519_program::check_id(program_id) {
if secp256k1_program::check_id(program_id)
|| ed25519_program::check_id(program_id)
|| secp256r1_program::check_id(program_id)
{
let num_signatures = ix.data.first().map_or(0, |byte| u64::from(*byte));
saturating_add_assign!(num_precompile_signatures, num_signatures);
}
Expand Down
1 change: 1 addition & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions svm/examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18564ab

Please sign in to comment.