-
Notifications
You must be signed in to change notification settings - Fork 943
fuzz-tests: improve fuzz-initial_channel
#8373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Changelog-None: The current test can leak memory due to improper cleanup in the case of an early return. Fix it.
Currently, `fuzz-initial_channel` doesn't verify the following functions in its target file, `common/initial_channel.h`: `channel_update_funding()` and `initial_channel_tx()`. Add a test for them.
Hey @morehouse, This target crashes for what is seemingly a bug but I'm not sure. I've added the crashing input to the corpus for you to take a look. Here is all I was able to uncover from my investigation: The fuzzer fails with the following assertion:
which traces back to the newly added
which in turn fails due to a condition inside
triggered by the fact that our transaction has
I looked around for callers of
This makes believe that it is probably some setup that we're missing or that this is an actual bug, but I'm unsure on how to proceed with investigating either of these. Any ideas? |
The commitment transaction has no outputs, which means both sides of the channel have balances below their designated Probably since this fuzz target skips all those checks, we can get all kinds of invalid channel parameters and cause problems. If we can trigger this assertion while satisfying those checks, we probably have a serious DoS vector. A straightforward way to determine if that's possible would be with state machine fuzzing of |
Add a couple of improvements to the fuzz test for
common/initial_channel.{c, h}
-tests/fuzz/fuzz-initial_channel
.Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked: