fuzz: connman: set m_local_services/m_use_addrman_outgoing/m_max_automatic_connections
What changed, and why it matters
This commit only changes a fuzz test file. Fuzz tests are automated tools that throw random inputs at code to find bugs. The change adds three new random settings to the test and adds two assertions to verify those settings are stored correctly. There is no change to the actual Bitcoin network code that users run, so this cannot directly affect live nodes or wallets.
No security action needed. Treat as a normal test/fuzzing improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies src/test/fuzz/connman.cpp to initialize CConnman options with fuzzer-provided values for m_local_services, m_use_addrman_outgoing, and m_max_automatic_connections. It also replaces two discarded-return calls with equality assertions so the fuzzer checks that GetLocalServices() and GetUseAddrmanOutgoing() return the values that were set. This is a test-coverage improvement, not a production code change.
Changed components
src/test/fuzz/connman.cppInspect captured patch +9 / −2
diff --git a/src/test/fuzz/connman.cpp b/src/test/fuzz/connman.cpp
index 0758dcfe..ff7f4ad7 100644
--- a/src/test/fuzz/connman.cpp
+++ b/src/test/fuzz/connman.cpp
@@ -81,6 +81,13 @@ FUZZ_TARGET(connman, .init = initialize_connman)
options.m_msgproc = &net_events;
options.nMaxOutboundLimit = max_outbound_limit;
+ const auto local_services{ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS)};
+ options.m_local_services = local_services;
+
+ const auto use_addrman_outgoing{fuzzed_data_provider.ConsumeBool()};
+ options.m_use_addrman_outgoing = use_addrman_outgoing;
+ options.m_max_automatic_connections = fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 1000);
+
auto consume_whitelist = [&]() {
std::vector<NetWhitelistPermissions> result(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 3));
for (auto& entry : result) {
@@ -245,7 +252,7 @@ FUZZ_TARGET(connman, .init = initialize_connman)
});
(void)connman.GetAddedNodeInfo(fuzzed_data_provider.ConsumeBool());
(void)connman.GetExtraFullOutboundCount();
- (void)connman.GetLocalServices();
+ assert(connman.GetLocalServices() == local_services);
assert(connman.GetMaxOutboundTarget() == max_outbound_limit);
(void)connman.GetMaxOutboundTimeframe();
(void)connman.GetMaxOutboundTimeLeftInCycle();
@@ -255,7 +262,7 @@ FUZZ_TARGET(connman, .init = initialize_connman)
(void)connman.GetTotalBytesRecv();
(void)connman.GetTotalBytesSent();
(void)connman.GetTryNewOutboundPeer();
- (void)connman.GetUseAddrmanOutgoing();
+ assert(connman.GetUseAddrmanOutgoing() == use_addrman_outgoing);
(void)connman.ASMapHealthCheck();
connman.ClearTestNodes();
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.