fuzz: push messages to one of m_nodes in connman target #36765

Manually merged
darosior merged 1 commit from 2611_connman_fuzz_fix into master 2026-11-06 10:15:47 +00:00 AGit
darosior commented 2026-11-04 19:58:06 +00:00 (Migrated from github.com)

The connman fuzz target never exercised m_nodes peers with queued messages, as their message queue is always empty. The most they ever had to send was handshake bytes in the case of v2 peers, so the socket handler only ever waited for SendEvent, and sent data, during a v2 handshake.

Fix this by pushing messages to one of the m_nodes peers instead of random_node, which is never added to connman.

The connman fuzz target never exercised `m_nodes` peers with queued messages, as their message queue is always empty. The most they ever had to send was handshake bytes in the case of v2 peers, so the socket handler only ever waited for SendEvent, and sent data, during a v2 handshake. Fix this by pushing messages to one of the `m_nodes` peers instead of `random_node`, which is never added to connman.
fanquake commented 2026-11-04 20:05:01 +00:00 (Migrated from github.com)

cc @Crypt-iQ @marcofleon

cc @Crypt-iQ @marcofleon
First-time contributor

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: ad51e87ecfd8 · Full review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:4d44b6ffa09c54db24f8f0ab27ae388beae06a733efcae741ca64db76bb1c938:7efd3c3ba41667382004cfa7a7db56605da7d8f9b7ab69bc483f27117390ba48 --> <!-- ralph-base:504aab70a08471fdb5f461e3b77aecaee5eab370 --> <!-- ralph-head:ad51e87ecfd8f4b27e703b5c6116e6d75dcb9787 --> <!-- ralph-case:ce4978f6c9aa124a06de98150e0bb3ece43d18b3b7093d7a85215f4808d34244 --> No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: routine --> --- Reviewed: [`ad51e87ecfd8`](<https://git.fish.foo/bitcoin/bitcoin/commit/ad51e87ecfd8f4b27e703b5c6116e6d75dcb9787>) · [Full review report](<https://review.fish.foo/traces/36765-ad51e87ecfd8f4b27e703b5c6116e6d75dcb9787-2164-1.html>) · [Previous reports](<https://review.fish.foo/traces/36765/>) [permalink](<https://review.fish.foo/traces/36765-ad51e87ecfd8f4b27e703b5c6116e6d75dcb9787-2164-1.html>)
darosior commented 2026-11-04 20:24:06 +00:00 (Migrated from github.com)

For reference, the PushMessage to random_node is an artifact of when the target was first introduced in 79ef8324d4, which as far as i understand it was attempting to maximize line coverage rather than meaningful coverage.

For reference, the PushMessage to random_node is an artifact of when the target was first introduced in 79ef8324d4c8, which as far as i understand it was attempting to maximize line coverage rather than meaningful coverage.
marcofleon (Migrated from github.com) reviewed 2026-11-05 17:26:34 +00:00
marcofleon (Migrated from github.com) left a comment

ACK ad51e87ecf

net.cpp coverage on master

net.cpp coverage this PR

V2Transport::SetMessageToSend() is hit by this target now that messages are being pushed to connman's actual peers, some of which are V2.

ACK ad51e87ecfd8f4b27e703b5c6116e6d75dcb9787 `net.cpp` [coverage](https://marcofleon.github.io/coverage/connman_master/coverage/root/bitcoin/src/net.cpp.html) on master `net.cpp` [coverage](https://marcofleon.github.io/coverage/connman_36765/coverage/root/bitcoin/src/net.cpp.html) this PR `V2Transport::SetMessageToSend()` is hit by this target now that messages are being pushed to connman's actual peers, some of which are V2.
DrahtBot commented 2026-11-05 17:26:37 +00:00 (Migrated from github.com)

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

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK marcofleon

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35888 (net: reject oversized outbound messages by l0rinc)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36765 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36765.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36765#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [marcofleon](https://github.com/bitcoin/bitcoin/pull/36765#pullrequestreview-5789146332) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#35888](https://github.com/bitcoin/bitcoin/pull/35888) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35888.svg"></sub> (net: reject oversized outbound messages by l0rinc) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36765
No description provided.