[do not merge] gosentry overflow-detection suppressions and run script - #23202
Draft
AskAlexSharov wants to merge 4 commits into
Draft
[do not merge] gosentry overflow-detection suppressions and run script#23202AskAlexSharov wants to merge 4 commits into
AskAlexSharov wants to merge 4 commits into
Conversation
Records the triage from running the gosentry toolchain over the unit suite, the fuzz targets and a syncing node. Every site marked here was checked and found to be deliberate modular arithmetic. Packages that are modular arithmetic end to end are exempted wholesale by misc/gosentry-run.sh rather than marked: murmur3 alone would need 40 markers. Single benign sites inside packages worth instrumenting are marked in place, so the rest of those packages keeps its checks. Not for merge: gosentry is not part of CI, and these markers only earn their place if it becomes a recurring audit.
…kages Round 2's site list was measured on a tree that already carried round 1's markers, so five landed below the arithmetic instead of above it and had no effect. Verified now: every marker sits directly above an arithmetic statement. Packages the script exempts wholesale no longer carry markers, murmur3 included: the exemption already covers them, and the wmul/wadd helpers diverged from the reference transcription for no gain.
zz_release_bench_test.go and hex_patricia_hashed_gosentry_test.go were untracked working-tree files picked up by an over-broad git add.
…ng ops Package-level -overflowdetect exemption does not survive inlining: a small exempted function inlined into an instrumented caller gets checks inserted at the call site. bitutil.Select64 fired from eliasfano32.get despite being exempted. Source markers do survive, so route the wrapping operations of the three small hot functions through marked helpers.
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.
Preserves the triage from running gosentry — a fork of the Go toolchain that panics on integer overflow/underflow at runtime — over the unit suite, the fuzz targets, and a syncing mainnet node. Not for merge: gosentry is not in CI, and these markers only earn their place if it becomes a recurring audit. Opened so the work is not lost.
The expensive part is not the code, it is knowing which sites are deliberate. Without this, the next instrumented run repeats the whole triage.
Two mechanisms, chosen by scope.
Packages that are modular arithmetic end to end are exempted wholesale in
misc/gosentry-run.sh. Marking them in place does not scale —Sum128WithSeedalone has 16 arithmetic operations, 40 across the file:Single benign sites inside packages worth instrumenting are marked in the source, so the rest of the package keeps its checks — the EVM is exactly where a real overflow would matter:
What was checked, and why each is benign.
murmur3,blake2b,recsplit.remix, ethash FNVuint64_t, Rust ports spell itwrapping_mulbitutil.Select,patricia.swarEdge,vm.codeBitmaptransaction_signing.go:421,contracts.go:335v - 27; a wrapped value lands in 229–255 andTransactionSignatureIsValidaccepts only 0 or 1txn_executor.go:307stNonce+1 < stNonceis itself the overflow checkvm/evm.go:233cache.go:245,cache_accessors.go:51prefix_trie.go,kvcache.go:241,nodedb.go:598,stage_senders.go:335Two real bugs came out of the same runs and are in their own PRs, not here: #23192 (AA gas limits summed unchecked;
parseBitlistmsb underflow) and #23173 (fuzz harness defects).Notes
misc/gosentry-run.shhasbuild,testandfuzzsubcommands. The fuzz path setsRUSTFLAGS=-C link-arg=-lstdc++, without which the LibAFL harness fails to link against evmone's C++ modexp.-truncationdetect=true) is deliberately not enabled: it fires within the first 1–4 executions of nearly every package and needs its own triage pass.common/murmur3here also carries awmul/waddhelper pair, kept as a worked example: two// overflow_false_positivemarkers silence all 40 sites because suppression survives inlining. The package exemption makes it redundant, and it diverges from the reference transcription, so it should probably be dropped before any merge. I did not measure whether the helpers are free — the benchmark run timed out.murmur3.go:41via every index lookup, thenrecsplit.go:86.