mirror of
https://github.com/monero-project/monero.git
synced 2025-12-05 20:40:22 -08: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"
|
||||
rust_host: "riscv64gc-unknown-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"
|
||||
host: "aarch64-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:
|
||||
- target: "x86_64-linux-gnu"
|
||||
- target: "aarch64-linux-gnu"
|
||||
- target: "arm-linux-gnueabihf"
|
||||
- target: "riscv64-linux-gnu"
|
||||
- target: "x86_64-w64-mingw32"
|
||||
- target: "x86_64-unknown-freebsd"
|
||||
|
||||
@@ -171,7 +171,7 @@ details.
|
||||
Override the space-separated list of platform triples for which to perform a
|
||||
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
|
||||
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)
|
||||
export HOSTS="${HOSTS:-x86_64-linux-gnu
|
||||
aarch64-linux-gnu
|
||||
arm-linux-gnueabihf
|
||||
riscv64-linux-gnu
|
||||
x86_64-w64-mingw32
|
||||
x86_64-unknown-freebsd
|
||||
|
||||
@@ -32,26 +32,26 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
FuzzedDataProvider provider(data, size);
|
||||
|
||||
// Randomly choose multiple fuzz_targets to fuzz
|
||||
int rpc_messages_to_send = provider.ConsumeIntegralInRange<int>(1, 16);
|
||||
std::vector<int> selectors;
|
||||
unsigned rpc_messages_to_send = provider.ConsumeIntegralInRange<unsigned>(1, 16);
|
||||
std::vector<unsigned> selectors;
|
||||
if (is_safe_mode) {
|
||||
selectors.reserve(rpc_messages_to_send);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
|
||||
// Randomly shuffle the selectors for priority fuzz targets
|
||||
for (int i = 0; i < priority_fuzz_targets.size(); i++) {
|
||||
int target = provider.ConsumeIntegralInRange<int>(0, priority_fuzz_targets.size() - 1);
|
||||
for (unsigned i = 0; i < priority_fuzz_targets.size(); i++) {
|
||||
unsigned target = provider.ConsumeIntegralInRange<unsigned>(0, priority_fuzz_targets.size() - 1);
|
||||
std::swap(selectors[i], selectors[target]);
|
||||
}
|
||||
}
|
||||
|
||||
// Randomly select rpc functions to call
|
||||
for (int i = 0; i < rpc_messages_to_send && provider.remaining_bytes() >= 2; ++i) {
|
||||
int selector = provider.ConsumeIntegralInRange<int>(0, fuzz_targets.size() - 1);
|
||||
for (unsigned i = 0; i < rpc_messages_to_send && provider.remaining_bytes() >= 2; ++i) {
|
||||
unsigned selector = provider.ConsumeIntegralInRange<unsigned>(0, fuzz_targets.size() - 1);
|
||||
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(*rpc_handler->rpc);
|
||||
|
||||
for (int selector : selectors) {
|
||||
for (unsigned selector : selectors) {
|
||||
try {
|
||||
// Fuzz the target function
|
||||
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) {
|
||||
cryptonote::tx_verification_context tvc;
|
||||
bool accepted = core.handle_incoming_tx(tx_blob, tvc, cryptonote::relay_method::block, true);
|
||||
if (accepted || tvc.m_added_to_pool) {
|
||||
added_txs = true;
|
||||
|
||||
// Store legit hashes
|
||||
cryptonote::transaction tx;
|
||||
if (cryptonote::parse_and_validate_tx_from_blob(tx_blob, tx)) {
|
||||
|
||||
Reference in New Issue
Block a user