Skip to content

Commit 63e8fc9

Browse files
committed
ci: add getchaintxstats ubsan suppressions
Add ubsan suppressions for integer overflows in the getchaintxstats RPC. getchainstatstx line "int nTxDiff = pindex->nChainTx - past_block.nChainTx" can trigger ubsan integer overflows when assumeutxo snapshots are loaded, from subtracting unsigned values and assigning the result to a signed int. The overflow behavior probably exists in current code but is hard to trigger because it would require calling getchainstatstx at the right time with specific parameters as background blocks are being downloaded. But the overflow behavior becomes easier to trigger in the upcoming commit removing fake nChainTx values, so a suppression needs to be added before then for CI to pass. getchainstatstx should probably be improved separately in another PR to not need this suppression, and handle edge cases and missing nChainTx values more carefully.
1 parent f252e68 commit 63e8fc9

File tree

1 file changed

+2
-0
lines changed
  • test/sanitizer_suppressions

1 file changed

+2
-0
lines changed

test/sanitizer_suppressions/ubsan

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ unsigned-integer-overflow:CCoinsViewCache::Uncache
5151
unsigned-integer-overflow:CompressAmount
5252
unsigned-integer-overflow:DecompressAmount
5353
unsigned-integer-overflow:crypto/
54+
unsigned-integer-overflow:getchaintxstats*
5455
unsigned-integer-overflow:MurmurHash3
5556
unsigned-integer-overflow:CBlockPolicyEstimator::processBlockTx
5657
unsigned-integer-overflow:TxConfirmStats::EstimateMedianVal
@@ -61,6 +62,7 @@ implicit-integer-sign-change:CBlockPolicyEstimator::processBlockTx
6162
implicit-integer-sign-change:SetStdinEcho
6263
implicit-integer-sign-change:compressor.h
6364
implicit-integer-sign-change:crypto/
65+
implicit-integer-sign-change:getchaintxstats*
6466
implicit-integer-sign-change:TxConfirmStats::removeTx
6567
implicit-integer-sign-change:prevector.h
6668
implicit-integer-sign-change:verify_flags

0 commit comments

Comments
 (0)