mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
test: add script_tests cases covering interpreter mutants #36291
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36291
Loading…
Reference in a new issue
No description provided.
Delete branch "kill-interpreter-mutants"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Kills some live mutants on
interpreter.cppfound by https://bitcoincore.space. They are:interpreter.cpp#5168:
IsCompressedOrUncompressedPubKey: pubkey with neither compressed nor uncompressed prefix returnstrueinterpreter.cpp#5191:
IsValidSignatureEncoding: 73-byte upper bound returnstrueinterpreter.cpp#5200:
IsValidSignatureEncoding: total-length byte check returnstrueinterpreter.cpp#5232:
IsValidSignatureEncoding: null R byte checklenR > 1->lenR >=1interpreter.cpp#5259:
IsValidSignatureEncoding: null S byte checklenS > 1->lenS >= 1interpreter.cpp#5186:
IsValidSignatureEncoding: 9-byte lower bound returnstrueThe first affects policy only, the next four affect consensus, and the last covers the lower bound and lets ASan catch UB: a 3-byte signature reaches the
sig[3]read that thesig.size() < 9guard protects.Recommend reviewing per commit.
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.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.cc @brunoerg
Base:
7988380da987c0b860885853ace8149b84ac2ee8Head:
efe0dfcf1e5c431c62dc9ac4fd2c2d97a62814feNo verified findings are available from this partial review.
Review coverage was incomplete. The archaeology review had incomplete evidence.
Full review report
d34cd78bd5: do we really need this 8-byte vector test? As far as I verified, the mutant is killed with the other test here (3-byte one).It is not necessary for killing the mutant. My reasoning was to add case that directly tests the lower bound. But thinking back no signature under 9 bytes is valid and the 3 byte case is only worth it because it causes UB. I will drop the 8 byte cases and keep the 3 byte one. Thanks for spotting this.
Done on
a0ce5b2629.Thanks @brunoerg for the review! Forced push
a0ce5b2629addressing comment https://github.com/bitcoin/bitcoin/pull/36291#discussion_r4125360401ACK
a0ce5b2629just left a nit, happy to re-ack if you decide to address it.
nit: do these new DERSIG test cases really need a real pubkey? I think an empty pubkey would work, e.g. "0 CHECKSIG NOT"
True, it is better to simplify these tests. I noticed this also applies for the sigs on cases of STRICTENC, so I simplified both DERSIG and STRICTENC added tests on
efe0dfcf1eThanks @brunoerg. Forced push
efe0dfcf1eaddressing https://github.com/bitcoin/bitcoin/pull/36291#discussion_r4128116862. See DERSIG cases diff and STRICTENC cases diffreACK
efe0dfcf1eACK
efe0dfcf1eI ran the 11 new rows through btclib's script interpreter and each gives the expected result and error code.
@ViniciusCestarii can you re-write the pull request descriptions of your mutations without having to nest html in it? Maybe just give every mutation as its minimized diff? The pull request description gets added to every merge commit and all the formatting makes it harder to render the same everywhere and a bit harder to read.
Updated the pr description.
ACK
efe0dfcf1e