Skip to content

dualopend: initialize state->reconnected on startup - #9484

Open
erickcestari wants to merge 1 commit into
ElementsProject:masterfrom
erickcestari:fix-ubsan-dualopend
Open

dualopend: initialize state->reconnected on startup#9484
erickcestari wants to merge 1 commit into
ElementsProject:masterfrom
erickcestari:fix-ubsan-dualopend

Conversation

@erickcestari

@erickcestari erickcestari commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

state->reconnected was only set to true after do_reconnect_dance(), so a fresh dualopend never wrote it. A commitment_signed arriving out of turn in the main loop made handle_commit_signed() read an uninitialized bool, which UBSan flags as a load of an invalid bool value.

Default it to false, so an out-of-turn commitment_signed is always rejected unless we really reconnected.

Changelog-None

Found this issue using Smite. Severity is low.

state->reconnected was only set to true after do_reconnect_dance(),
so a fresh dualopend never wrote it.  A commitment_signed arriving
out of turn in the main loop made handle_commit_signed() read an
uninitialized bool, which UBSan flags as a load of an invalid bool
value.

Default it to false, so an out-of-turn commitment_signed is always
rejected unless we really reconnected.

Changelog-None

Signed-off-by: Erick Cestari <erickcestari03@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant