mirror of
https://github.com/monero-project/monero.git
synced 2025-12-15 11:31:28 +09:00
Compare commits
4 Commits
fc812cdc14
...
8a53c96b12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a53c96b12 | ||
|
|
cdbf147c8b | ||
|
|
c3ee9ac707 | ||
|
|
32d9359b9a |
4
.github/workflows/depends.yml
vendored
4
.github/workflows/depends.yml
vendored
@ -38,10 +38,6 @@ jobs:
|
|||||||
host: "riscv64-linux-gnu"
|
host: "riscv64-linux-gnu"
|
||||||
rust_host: "riscv64gc-unknown-linux-gnu"
|
rust_host: "riscv64gc-unknown-linux-gnu"
|
||||||
packages: "g++-riscv64-linux-gnu"
|
packages: "g++-riscv64-linux-gnu"
|
||||||
- name: "ARM v7"
|
|
||||||
host: "arm-linux-gnueabihf"
|
|
||||||
rust_host: "armv7-unknown-linux-gnueabihf"
|
|
||||||
packages: "g++-arm-linux-gnueabihf"
|
|
||||||
- name: "ARM v8"
|
- name: "ARM v8"
|
||||||
host: "aarch64-linux-gnu"
|
host: "aarch64-linux-gnu"
|
||||||
rust_host: "aarch64-unknown-linux-gnu"
|
rust_host: "aarch64-unknown-linux-gnu"
|
||||||
|
|||||||
1
.github/workflows/guix.yml
vendored
1
.github/workflows/guix.yml
vendored
@ -42,7 +42,6 @@ jobs:
|
|||||||
toolchain:
|
toolchain:
|
||||||
- target: "x86_64-linux-gnu"
|
- target: "x86_64-linux-gnu"
|
||||||
- target: "aarch64-linux-gnu"
|
- target: "aarch64-linux-gnu"
|
||||||
- target: "arm-linux-gnueabihf"
|
|
||||||
- target: "riscv64-linux-gnu"
|
- target: "riscv64-linux-gnu"
|
||||||
- target: "x86_64-w64-mingw32"
|
- target: "x86_64-w64-mingw32"
|
||||||
- target: "x86_64-unknown-freebsd"
|
- target: "x86_64-unknown-freebsd"
|
||||||
|
|||||||
@ -171,7 +171,7 @@ details.
|
|||||||
Override the space-separated list of platform triples for which to perform a
|
Override the space-separated list of platform triples for which to perform a
|
||||||
bootstrappable build.
|
bootstrappable build.
|
||||||
|
|
||||||
_(defaults to "x86\_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf
|
_(defaults to "x86\_64-linux-gnu aarch64-linux-gnu
|
||||||
riscv64-linux-gnu x86\_64-w64-mingw32 x86\_64-unknown-freebsd
|
riscv64-linux-gnu x86\_64-w64-mingw32 x86\_64-unknown-freebsd
|
||||||
x86\_64-apple-darwin arm64-apple-darwin aarch64-linux-android")_
|
x86\_64-apple-darwin arm64-apple-darwin aarch64-linux-android")_
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,6 @@ mkdir -p "$VERSION_BASE"
|
|||||||
# Default to building for all supported HOSTs (overridable by environment)
|
# Default to building for all supported HOSTs (overridable by environment)
|
||||||
export HOSTS="${HOSTS:-x86_64-linux-gnu
|
export HOSTS="${HOSTS:-x86_64-linux-gnu
|
||||||
aarch64-linux-gnu
|
aarch64-linux-gnu
|
||||||
arm-linux-gnueabihf
|
|
||||||
riscv64-linux-gnu
|
riscv64-linux-gnu
|
||||||
x86_64-w64-mingw32
|
x86_64-w64-mingw32
|
||||||
x86_64-unknown-freebsd
|
x86_64-unknown-freebsd
|
||||||
|
|||||||
@ -32,26 +32,26 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||||||
FuzzedDataProvider provider(data, size);
|
FuzzedDataProvider provider(data, size);
|
||||||
|
|
||||||
// Randomly choose multiple fuzz_targets to fuzz
|
// Randomly choose multiple fuzz_targets to fuzz
|
||||||
int rpc_messages_to_send = provider.ConsumeIntegralInRange<int>(1, 16);
|
unsigned rpc_messages_to_send = provider.ConsumeIntegralInRange<unsigned>(1, 16);
|
||||||
std::vector<int> selectors;
|
std::vector<unsigned> selectors;
|
||||||
if (is_safe_mode) {
|
if (is_safe_mode) {
|
||||||
selectors.reserve(rpc_messages_to_send);
|
selectors.reserve(rpc_messages_to_send);
|
||||||
} else {
|
} else {
|
||||||
selectors.reserve(rpc_messages_to_send + priority_fuzz_targets.size());
|
selectors.reserve(rpc_messages_to_send + priority_fuzz_targets.size());
|
||||||
for (int i = 0; i < priority_fuzz_targets.size(); ++i) {
|
for (unsigned i = 0; i < priority_fuzz_targets.size(); ++i) {
|
||||||
selectors.push_back(i);
|
selectors.push_back(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Randomly shuffle the selectors for priority fuzz targets
|
// Randomly shuffle the selectors for priority fuzz targets
|
||||||
for (int i = 0; i < priority_fuzz_targets.size(); i++) {
|
for (unsigned i = 0; i < priority_fuzz_targets.size(); i++) {
|
||||||
int target = provider.ConsumeIntegralInRange<int>(0, priority_fuzz_targets.size() - 1);
|
unsigned target = provider.ConsumeIntegralInRange<unsigned>(0, priority_fuzz_targets.size() - 1);
|
||||||
std::swap(selectors[i], selectors[target]);
|
std::swap(selectors[i], selectors[target]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Randomly select rpc functions to call
|
// Randomly select rpc functions to call
|
||||||
for (int i = 0; i < rpc_messages_to_send && provider.remaining_bytes() >= 2; ++i) {
|
for (unsigned i = 0; i < rpc_messages_to_send && provider.remaining_bytes() >= 2; ++i) {
|
||||||
int selector = provider.ConsumeIntegralInRange<int>(0, fuzz_targets.size() - 1);
|
unsigned selector = provider.ConsumeIntegralInRange<unsigned>(0, fuzz_targets.size() - 1);
|
||||||
selectors.push_back(selector);
|
selectors.push_back(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||||||
// Disable bootstrap daemon
|
// Disable bootstrap daemon
|
||||||
disable_bootstrap_daemon(*rpc_handler->rpc);
|
disable_bootstrap_daemon(*rpc_handler->rpc);
|
||||||
|
|
||||||
for (int selector : selectors) {
|
for (unsigned selector : selectors) {
|
||||||
try {
|
try {
|
||||||
// Fuzz the target function
|
// Fuzz the target function
|
||||||
fuzz_targets[selector](*rpc_handler->rpc, provider);
|
fuzz_targets[selector](*rpc_handler->rpc, provider);
|
||||||
|
|||||||
@ -338,13 +338,10 @@ bool generate_random_blocks(cryptonote::core& core, FuzzedDataProvider& provider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool added_txs = false;
|
|
||||||
for (const auto& tx_blob : cached_txs) {
|
for (const auto& tx_blob : cached_txs) {
|
||||||
cryptonote::tx_verification_context tvc;
|
cryptonote::tx_verification_context tvc;
|
||||||
bool accepted = core.handle_incoming_tx(tx_blob, tvc, cryptonote::relay_method::block, true);
|
bool accepted = core.handle_incoming_tx(tx_blob, tvc, cryptonote::relay_method::block, true);
|
||||||
if (accepted || tvc.m_added_to_pool) {
|
if (accepted || tvc.m_added_to_pool) {
|
||||||
added_txs = true;
|
|
||||||
|
|
||||||
// Store legit hashes
|
// Store legit hashes
|
||||||
cryptonote::transaction tx;
|
cryptonote::transaction tx;
|
||||||
if (cryptonote::parse_and_validate_tx_from_blob(tx_blob, tx)) {
|
if (cryptonote::parse_and_validate_tx_from_blob(tx_blob, tx)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user