fuzz: set whitelist permissions on connman target #34742

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2026-03-connman changing 1 files +12 −0
  1. brunoerg commented at 12:49 pm on March 5, 2026: contributor
    I noticed that AddWhitelistPermissionFlags was always being called with an empty ranges (whitelist permissions). This function is called when connecting to a node (ConnectNode), and if the connection is a manual one, it uses the vWhitelistedRangeOutgoing to populate the permissions. However, since we were not setting any whitelist permission on the target, this vector is always empty. This PR improves this target by populating both vWhitelistedRangeIncoming and vWhitelistedRangeOutgoing.
  2. fuzz: set whitelist permissions on connman target 32debfa1ed
  3. DrahtBot added the label Fuzzing on Mar 5, 2026
  4. DrahtBot commented at 12:49 pm on March 5, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Crypt-iQ, frankomosh, maflcko

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. in src/test/fuzz/connman.cpp:86 in 32debfa1ed
    78@@ -79,6 +79,18 @@ FUZZ_TARGET(connman, .init = initialize_connman)
    79     CConnman::Options options;
    80     options.m_msgproc = &net_events;
    81     options.nMaxOutboundLimit = max_outbound_limit;
    82+
    83+    auto consume_whitelist = [&]() {
    84+        std::vector<NetWhitelistPermissions> result(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 3));
    85+        for (auto& entry : result) {
    86+            entry.m_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
    


    frankomosh commented at 7:35 am on March 10, 2026:
    nit: Should this exclude Implicit? I think TryParsePermissionFlags never produces it with other flags.

    brunoerg commented at 1:38 pm on March 10, 2026:
    I think Implicit would be considered as if both -whitebind or -whitelist had not been defined, perhaps we can leave it as is.

    frankomosh commented at 5:57 am on March 18, 2026:
    fair enough, makes sense to leave it.
  6. frankomosh commented at 7:36 am on March 10, 2026: contributor
    Concept ACK
  7. Crypt-iQ commented at 7:59 pm on March 17, 2026: contributor
    utACK 32debfa1ed8168bca0b6d2f191d2e3e940f6029b
  8. DrahtBot requested review from frankomosh on Mar 17, 2026
  9. frankomosh commented at 5:58 am on March 18, 2026: contributor
    crACK 32debfa1ed8168bca0b6d2f191d2e3e940f6029b
  10. maflcko commented at 7:55 am on March 18, 2026: member

    lgtm ACK 32debfa1ed8168bca0b6d2f191d2e3e940f6029b

    I think it would be useful to include steps to test this. E.g. by showcasing one additional line of coverage that is achieved, where is previously wasn’t.

  11. fanquake merged this on Mar 18, 2026
  12. fanquake closed this on Mar 18, 2026

  13. brunoerg deleted the branch on Mar 18, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-12 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me