Repository navigation
Reject channels if the total reserves are larger than the funding - #1454
Merged
TheBlueMatt merged 2 commits intoApr 28, 2022
Merged
Conversation
TheBlueMatt
force-pushed
the
2022-04-fuzz-underflow
branch
from
April 26, 2022 21:07
70957cd to
3bc962a
Compare
vincenzopalazzo
previously approved these changes
Apr 27, 2022
jkczyz
reviewed
Apr 28, 2022
valentinewallace
previously approved these changes
Apr 28, 2022
jkczyz
previously approved these changes
Apr 28, 2022
The `full_stack_target` fuzzer managed to find a subtraction underflow in the new `Channel::get_htlc_maximum` function where we subtract both sides' reserve values from the channel funding. Such a channel is obviously completely useless, so we should reject it during opening instead of integer-underflowing later. Thanks to Chaincode Labs for providing the fuzzing resources which found this bug!
The calculation uses the reserve, so we should mention it in the error we send to our peers.
TheBlueMatt
dismissed stale reviews from jkczyz and valentinewallace
via
April 28, 2022 19:47
92c87ba
TheBlueMatt
force-pushed
the
2022-04-fuzz-underflow
branch
from
April 28, 2022 19:47
4525c47 to
92c87ba
Compare
Collaborator
Author
|
Oops, missed a test had the same error in it, fixed that and made the fixup a Real Commit instead. |
valentinewallace
approved these changes
Apr 28, 2022
jkczyz
approved these changes
Apr 28, 2022
dunxen
approved these changes
Apr 28, 2022
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.
The
full_stack_targetfuzzer managed to find a subtractionunderflow in the new
Channel::get_htlc_maximumfunction where wesubtract both sides' reserve values from the channel funding. Such
a channel is obviously completely useless, so we should reject it
during opening instead of integer-underflowing later.
Thanks to Chaincode Labs for providing the fuzzing resources which
found this bug!