dualopend: initialize state->reconnected on startup - #9484
Open
erickcestari wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
state->reconnectedwas only set to true afterdo_reconnect_dance(), so a fresh dualopend never wrote it. Acommitment_signedarriving out of turn in the main loop madehandle_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_signedis always rejected unless we really reconnected.Changelog-None
Found this issue using Smite. Severity is low.